MCPcopy Create free account
hub / github.com/hashintel/hash / queryEntities

Function queryEntities

libs/@local/graph/sdk/typescript/src/entity.ts:1510–1537  ·  view source on GitHub ↗
(
  context: {
    graphApi: GraphApi;
  },
  authentication: AuthenticationContext,
  params: QueryEntitiesRequest,
)

Source from the content-addressed store, hash-verified

1508}
1509
1510export const queryEntities = async <
1511 PropertyMap extends TypeIdsAndPropertiesForEntity =
1512 TypeIdsAndPropertiesForEntity,
1513>(
1514 context: {
1515 graphApi: GraphApi;
1516 },
1517 authentication: AuthenticationContext,
1518 params: QueryEntitiesRequest,
1519): Promise<QueryEntitiesResponse<PropertyMap>> => {
1520 return context.graphApi
1521 .queryEntities(authentication.actorId, params)
1522 .then(({ data: response }) => ({
1523 ...response,
1524 entities: response.entities.map((entity) => new HashEntity(entity)),
1525 closedMultiEntityTypes: response.closedMultiEntityTypes
1526 ? mapGraphApiClosedMultiEntityTypeMapToClosedMultiEntityTypeMap(
1527 response.closedMultiEntityTypes,
1528 )
1529 : undefined,
1530 definitions: response.definitions
1531 ? mapGraphApiEntityTypeResolveDefinitionsToEntityTypeResolveDefinitions(
1532 response.definitions,
1533 )
1534 : undefined,
1535 permissions: response.permissions as EntityPermissionsMap | undefined,
1536 }));
1537};
1538
1539export const searchEntities = async (
1540 context: {

Callers 15

findExistingEntityFunction · 0.90
findExistingLinkFunction · 0.90
getEntitiesByLinearIdFunction · 0.90
getEntityOutgoingLinksFunction · 0.90
getLatestEntityByIdFunction · 0.90
getFileEntityFunction · 0.90
processQueueMessageFunction · 0.90
getUsageRecordsResolverFunction · 0.90
queryEntitiesResolverFunction · 0.90
getEntityIncomingLinksFunction · 0.90
getEntityOutgoingLinksFunction · 0.90

Tested by

no test coverage detected