(params: {
entityTypeIds: T["entityTypeIds"];
properties: T["propertiesWithMetadata"];
linkData?: LinkData;
})
| 13 | } from "@blockprotocol/type-system"; |
| 14 | |
| 15 | export const createEntity = <T extends TypeIdsAndPropertiesForEntity>(params: { |
| 16 | entityTypeIds: T["entityTypeIds"]; |
| 17 | properties: T["propertiesWithMetadata"]; |
| 18 | linkData?: LinkData; |
| 19 | }): Promise<HashEntity<T>> => |
| 20 | queryGraphQlApi<CreateEntityMutation, CreateEntityMutationVariables>( |
| 21 | createEntityMutation, |
| 22 | { |
| 23 | entityTypeIds: params.entityTypeIds, |
| 24 | properties: params.properties, |
| 25 | linkData: params.linkData, |
| 26 | }, |
| 27 | ).then(({ data }) => { |
| 28 | return new HashEntity<T>(data.createEntity); |
| 29 | }); |
no test coverage detected