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

Function updateEntity

apps/plugin-browser/src/shared/storage/update-entity.ts:18–34  ·  view source on GitHub ↗
(params: {
  entityId: EntityId;
  entityTypeIds: T["entityTypeIds"];
  updatedProperties: T["propertiesWithMetadata"];
})

Source from the content-addressed store, hash-verified

16} from "@blockprotocol/type-system";
17
18export const updateEntity = <T extends TypeIdsAndPropertiesForEntity>(params: {
19 entityId: EntityId;
20 entityTypeIds: T["entityTypeIds"];
21 updatedProperties: T["propertiesWithMetadata"];
22}): Promise<HashEntity<T>> =>
23 queryGraphQlApi<UpdateEntityMutation, UpdateEntityMutationVariables>(
24 updateEntityMutation,
25 {
26 entityUpdate: {
27 entityId: params.entityId,
28 entityTypeIds: params.entityTypeIds,
29 propertyPatches: propertyObjectToPatches(params.updatedProperties),
30 },
31 },
32 ).then(({ data }) => {
33 return new HashEntity(data.updateEntity);
34 });

Callers

nothing calls this directly

Calls 3

queryGraphQlApiFunction · 0.90
propertyObjectToPatchesFunction · 0.90
thenMethod · 0.80

Tested by

no test coverage detected