From 1c2245a7d9ab183110582cf990e5f96850657204 Mon Sep 17 00:00:00 2001 From: Nik Graf Date: Tue, 5 Aug 2025 19:19:54 +0200 Subject: [PATCH 1/3] upgrade grc-20 and data types, update queries using value --- apps/connect/package.json | 2 +- apps/connect/src/routes/index.tsx | 1 - .../template-nextjs/package.json | 2 +- .../template-vite-react/package.json | 2 +- apps/events/package.json | 2 +- .../create-properties-and-types-todos.tsx | 4 +- apps/events/src/components/playground.tsx | 2 +- apps/next-example/package.json | 2 +- apps/typesync/client/src/generated/graphql.ts | 298 ++++++++++++------ .../src/hooks/useSchemaBrowserQuery.tsx | 2 +- .../client/src/routes/apps/create.tsx | 6 +- apps/typesync/client/src/utils/mapper.ts | 6 +- apps/typesync/domain/Domain.ts | 2 +- apps/typesync/package.json | 2 +- apps/typesync/src/Generator.ts | 10 +- package.json | 2 +- packages/hypergraph-react/package.json | 2 +- .../src/internal/use-create-entity-public.ts | 2 +- .../src/internal/use-query-public.tsx | 80 +++-- .../hypergraph-react/src/prepare-publish.ts | 29 +- .../test/prepare-publish.test.ts | 6 +- packages/hypergraph/package.json | 2 +- packages/hypergraph/src/mapping/Mapping.ts | 4 +- .../hypergraph/test/mapping/Mapping.test.ts | 4 +- packages/typesync/package.json | 2 +- packages/typesync/src/Mapping.ts | 24 +- packages/typesync/test/Mapping.test.ts | 41 ++- pnpm-lock.yaml | 266 ++-------------- 28 files changed, 372 insertions(+), 435 deletions(-) diff --git a/apps/connect/package.json b/apps/connect/package.json index e1f899f5..a1b79db6 100644 --- a/apps/connect/package.json +++ b/apps/connect/package.json @@ -15,7 +15,7 @@ }, "dependencies": { "@base-ui-components/react": "1.0.0-beta.1", - "@graphprotocol/grc-20": "^0.23.1", + "@graphprotocol/grc-20": "^0.24.1", "@graphprotocol/hypergraph": "workspace:*", "@graphprotocol/hypergraph-react": "workspace:*", "@heroicons/react": "^2.2.0", diff --git a/apps/connect/src/routes/index.tsx b/apps/connect/src/routes/index.tsx index 964c8295..c27bbe2e 100644 --- a/apps/connect/src/routes/index.tsx +++ b/apps/connect/src/routes/index.tsx @@ -1,4 +1,3 @@ -import { Graph } from '@graphprotocol/grc-20'; import { useIdentityToken } from '@privy-io/react-auth'; import { createFileRoute } from '@tanstack/react-router'; import { CreateSpaceCard } from '@/components/CreateSpaceCard'; diff --git a/apps/create-hypergraph/template-nextjs/package.json b/apps/create-hypergraph/template-nextjs/package.json index 5f570552..f50cd159 100644 --- a/apps/create-hypergraph/template-nextjs/package.json +++ b/apps/create-hypergraph/template-nextjs/package.json @@ -15,7 +15,7 @@ }, "type": "module", "dependencies": { - "@graphprotocol/grc-20": "^0.23.1", + "@graphprotocol/grc-20": "^0.24.1", "@graphprotocol/hypergraph": "workspace:*", "@graphprotocol/hypergraph-react": "workspace:*", "@radix-ui/react-navigation-menu": "^1.2.13", diff --git a/apps/create-hypergraph/template-vite-react/package.json b/apps/create-hypergraph/template-vite-react/package.json index 2114af5d..36e7c2a6 100644 --- a/apps/create-hypergraph/template-vite-react/package.json +++ b/apps/create-hypergraph/template-vite-react/package.json @@ -11,7 +11,7 @@ "typecheck": "tsc --noEmit" }, "dependencies": { - "@graphprotocol/grc-20": "^0.23.1", + "@graphprotocol/grc-20": "^0.24.1", "@graphprotocol/hypergraph": "workspace:*", "@graphprotocol/hypergraph-react": "workspace:*", "@radix-ui/react-navigation-menu": "^1.2.13", diff --git a/apps/events/package.json b/apps/events/package.json index e0c81122..706cf556 100644 --- a/apps/events/package.json +++ b/apps/events/package.json @@ -9,7 +9,7 @@ "typesync": "hypergraph typesync" }, "dependencies": { - "@graphprotocol/grc-20": "^0.23.1", + "@graphprotocol/grc-20": "^0.24.1", "@graphprotocol/hypergraph": "workspace:*", "@graphprotocol/hypergraph-react": "workspace:*", "@noble/hashes": "^1.8.0", diff --git a/apps/events/src/components/create-properties-and-types-todos.tsx b/apps/events/src/components/create-properties-and-types-todos.tsx index 81c3da03..9350afa4 100644 --- a/apps/events/src/components/create-properties-and-types-todos.tsx +++ b/apps/events/src/components/create-properties-and-types-todos.tsx @@ -14,7 +14,7 @@ const createPropertiesAndTypesTodos = async ({ }) => { const ops: Array = []; const { id: checkedPropertyId, ops: createCheckedPropertyOps } = Graph.createProperty({ - dataType: 'CHECKBOX', + dataType: 'BOOLEAN', name: 'Checked', }); ops.push(...createCheckedPropertyOps); @@ -50,7 +50,7 @@ const createPropertiesAndTypesTodos = async ({ ops.push(...createAmountPropertyOps); const { id: websitePropertyId, ops: createWebsitePropertyOps } = Graph.createProperty({ - dataType: 'TEXT', + dataType: 'STRING', name: 'Website', }); ops.push(...createWebsitePropertyOps); diff --git a/apps/events/src/components/playground.tsx b/apps/events/src/components/playground.tsx index 732ce722..5505de57 100644 --- a/apps/events/src/components/playground.tsx +++ b/apps/events/src/components/playground.tsx @@ -17,7 +17,7 @@ export const Playground = ({ spaceId }: { spaceId: string }) => { jobOffers: {}, }, }, - first: 10, + first: 100, space: spaceId, }); const [isDeleting, setIsDeleting] = useState(false); diff --git a/apps/next-example/package.json b/apps/next-example/package.json index 1105675c..bd796655 100644 --- a/apps/next-example/package.json +++ b/apps/next-example/package.json @@ -11,7 +11,7 @@ }, "type": "module", "dependencies": { - "@graphprotocol/grc-20": "^0.23.1", + "@graphprotocol/grc-20": "^0.24.1", "@graphprotocol/hypergraph": "workspace:*", "@graphprotocol/hypergraph-react": "workspace:*", "next": "15.3.2", diff --git a/apps/typesync/client/src/generated/graphql.ts b/apps/typesync/client/src/generated/graphql.ts index 5325f1b3..58c3d197 100644 --- a/apps/typesync/client/src/generated/graphql.ts +++ b/apps/typesync/client/src/generated/graphql.ts @@ -9,24 +9,18 @@ export type MakeEmpty = export type Incremental = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never }; /** All built-in and custom scalars, mapped to their actual values */ export type Scalars = { - ID: { input: string; output: string; } - String: { input: string; output: string; } - Boolean: { input: boolean; output: boolean; } - Int: { input: number; output: number; } - Float: { input: number; output: number; } + ID: { input: string; output: string }; + String: { input: string; output: string }; + Boolean: { input: boolean; output: boolean }; + Int: { input: number; output: number }; + Float: { input: number; output: number }; /** A location in a connection that can be used for resuming pagination. */ - Cursor: { input: any; output: any; } + Cursor: { input: any; output: any }; /** A universally unique identifier as defined by [RFC 4122](https://tools.ietf.org/html/rfc4122). */ - UUID: { input: string; output: string; } + UUID: { input: string; output: string }; }; -export type DataTypes = - | 'CHECKBOX' - | 'NUMBER' - | 'POINT' - | 'RELATION' - | 'TEXT' - | 'TIME'; +export type DataTypes = 'BOOLEAN' | 'NUMBER' | 'POINT' | 'RELATION' | 'STRING' | 'TIME'; /** A filter to be used against DataTypes fields. All fields are combined with a logical ‘and.’ */ export type DataTypesFilter = { @@ -143,12 +137,7 @@ export type EntitiesEdge = { }; /** Methods to use when ordering `Entity`. */ -export type EntitiesOrderBy = - | 'ID_ASC' - | 'ID_DESC' - | 'NATURAL' - | 'PRIMARY_KEY_ASC' - | 'PRIMARY_KEY_DESC'; +export type EntitiesOrderBy = 'ID_ASC' | 'ID_DESC' | 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC'; export type Entity = Node & { __typename?: 'Entity'; @@ -193,7 +182,6 @@ export type Entity = Node & { valuesList: Array; }; - export type EntityBacklinksArgs = { after?: InputMaybe; before?: InputMaybe; @@ -205,7 +193,6 @@ export type EntityBacklinksArgs = { orderBy?: InputMaybe>; }; - export type EntityBacklinksListArgs = { condition?: InputMaybe; filter?: InputMaybe; @@ -214,7 +201,6 @@ export type EntityBacklinksListArgs = { orderBy?: InputMaybe>; }; - export type EntityPropertiesArgs = { filter?: InputMaybe; first?: InputMaybe; @@ -222,7 +208,6 @@ export type EntityPropertiesArgs = { spaceId?: InputMaybe; }; - export type EntityPropertiesConnectionArgs = { after?: InputMaybe; before?: InputMaybe; @@ -233,7 +218,6 @@ export type EntityPropertiesConnectionArgs = { spaceId?: InputMaybe; }; - export type EntityRelationsArgs = { after?: InputMaybe; before?: InputMaybe; @@ -245,7 +229,6 @@ export type EntityRelationsArgs = { orderBy?: InputMaybe>; }; - export type EntityRelationsListArgs = { condition?: InputMaybe; filter?: InputMaybe; @@ -254,7 +237,6 @@ export type EntityRelationsListArgs = { orderBy?: InputMaybe>; }; - export type EntityRelationsWhereEntityArgs = { after?: InputMaybe; before?: InputMaybe; @@ -266,7 +248,6 @@ export type EntityRelationsWhereEntityArgs = { orderBy?: InputMaybe>; }; - export type EntityRelationsWhereEntityListArgs = { condition?: InputMaybe; filter?: InputMaybe; @@ -275,14 +256,12 @@ export type EntityRelationsWhereEntityListArgs = { orderBy?: InputMaybe>; }; - export type EntitySpacesInArgs = { filter?: InputMaybe; first?: InputMaybe; offset?: InputMaybe; }; - export type EntitySpacesInConnectionArgs = { after?: InputMaybe; before?: InputMaybe; @@ -292,14 +271,12 @@ export type EntitySpacesInConnectionArgs = { offset?: InputMaybe; }; - export type EntityTypesArgs = { filter?: InputMaybe; first?: InputMaybe; offset?: InputMaybe; }; - export type EntityTypesConnectionArgs = { after?: InputMaybe; before?: InputMaybe; @@ -309,7 +286,6 @@ export type EntityTypesConnectionArgs = { offset?: InputMaybe; }; - export type EntityValuesArgs = { after?: InputMaybe; before?: InputMaybe; @@ -321,7 +297,6 @@ export type EntityValuesArgs = { orderBy?: InputMaybe>; }; - export type EntityValuesListArgs = { condition?: InputMaybe; filter?: InputMaybe; @@ -508,12 +483,7 @@ export type MetasEdge = { }; /** Methods to use when ordering `Meta`. */ -export type MetasOrderBy = - | 'ID_ASC' - | 'ID_DESC' - | 'NATURAL' - | 'PRIMARY_KEY_ASC' - | 'PRIMARY_KEY_DESC'; +export type MetasOrderBy = 'ID_ASC' | 'ID_DESC' | 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC'; /** An object with a globally unique `ID`. */ export type Node = { @@ -582,14 +552,12 @@ export type Property = Node & { renderableType?: Maybe; }; - export type PropertyRelationValueTypesArgs = { filter?: InputMaybe; first?: InputMaybe; offset?: InputMaybe; }; - export type PropertyRelationValueTypesConnectionArgs = { after?: InputMaybe; before?: InputMaybe; @@ -737,13 +705,11 @@ export type Query = Node & { valuesConnection?: Maybe; }; - /** The root query type which gives access points into the data universe. */ export type QueryEditorByNodeIdArgs = { nodeId: Scalars['ID']['input']; }; - /** The root query type which gives access points into the data universe. */ export type QueryEditorsArgs = { condition?: InputMaybe; @@ -753,7 +719,6 @@ export type QueryEditorsArgs = { orderBy?: InputMaybe>; }; - /** The root query type which gives access points into the data universe. */ export type QueryEditorsConnectionArgs = { after?: InputMaybe; @@ -766,7 +731,6 @@ export type QueryEditorsConnectionArgs = { orderBy?: InputMaybe>; }; - /** The root query type which gives access points into the data universe. */ export type QueryEntitiesArgs = { condition?: InputMaybe; @@ -776,7 +740,6 @@ export type QueryEntitiesArgs = { orderBy?: InputMaybe>; }; - /** The root query type which gives access points into the data universe. */ export type QueryEntitiesConnectionArgs = { after?: InputMaybe; @@ -789,25 +752,21 @@ export type QueryEntitiesConnectionArgs = { orderBy?: InputMaybe>; }; - /** The root query type which gives access points into the data universe. */ export type QueryEntityArgs = { id: Scalars['UUID']['input']; }; - /** The root query type which gives access points into the data universe. */ export type QueryEntityByNodeIdArgs = { nodeId: Scalars['ID']['input']; }; - /** The root query type which gives access points into the data universe. */ export type QueryMemberByNodeIdArgs = { nodeId: Scalars['ID']['input']; }; - /** The root query type which gives access points into the data universe. */ export type QueryMembersArgs = { condition?: InputMaybe; @@ -817,7 +776,6 @@ export type QueryMembersArgs = { orderBy?: InputMaybe>; }; - /** The root query type which gives access points into the data universe. */ export type QueryMembersConnectionArgs = { after?: InputMaybe; @@ -830,19 +788,16 @@ export type QueryMembersConnectionArgs = { orderBy?: InputMaybe>; }; - /** The root query type which gives access points into the data universe. */ export type QueryMetaArgs = { id: Scalars['String']['input']; }; - /** The root query type which gives access points into the data universe. */ export type QueryMetaByNodeIdArgs = { nodeId: Scalars['ID']['input']; }; - /** The root query type which gives access points into the data universe. */ export type QueryMetasArgs = { condition?: InputMaybe; @@ -852,7 +807,6 @@ export type QueryMetasArgs = { orderBy?: InputMaybe>; }; - /** The root query type which gives access points into the data universe. */ export type QueryMetasConnectionArgs = { after?: InputMaybe; @@ -865,13 +819,11 @@ export type QueryMetasConnectionArgs = { orderBy?: InputMaybe>; }; - /** The root query type which gives access points into the data universe. */ export type QueryNodeArgs = { nodeId: Scalars['ID']['input']; }; - /** The root query type which gives access points into the data universe. */ export type QueryPropertiesArgs = { condition?: InputMaybe; @@ -881,7 +833,6 @@ export type QueryPropertiesArgs = { orderBy?: InputMaybe>; }; - /** The root query type which gives access points into the data universe. */ export type QueryPropertiesConnectionArgs = { after?: InputMaybe; @@ -894,31 +845,26 @@ export type QueryPropertiesConnectionArgs = { orderBy?: InputMaybe>; }; - /** The root query type which gives access points into the data universe. */ export type QueryPropertyArgs = { id: Scalars['UUID']['input']; }; - /** The root query type which gives access points into the data universe. */ export type QueryPropertyByNodeIdArgs = { nodeId: Scalars['ID']['input']; }; - /** The root query type which gives access points into the data universe. */ export type QueryRelationArgs = { id: Scalars['UUID']['input']; }; - /** The root query type which gives access points into the data universe. */ export type QueryRelationByNodeIdArgs = { nodeId: Scalars['ID']['input']; }; - /** The root query type which gives access points into the data universe. */ export type QueryRelationsArgs = { condition?: InputMaybe; @@ -928,7 +874,6 @@ export type QueryRelationsArgs = { orderBy?: InputMaybe>; }; - /** The root query type which gives access points into the data universe. */ export type QueryRelationsConnectionArgs = { after?: InputMaybe; @@ -941,7 +886,6 @@ export type QueryRelationsConnectionArgs = { orderBy?: InputMaybe>; }; - /** The root query type which gives access points into the data universe. */ export type QuerySearchArgs = { filter?: InputMaybe; @@ -952,7 +896,6 @@ export type QuerySearchArgs = { spaceId?: InputMaybe; }; - /** The root query type which gives access points into the data universe. */ export type QuerySearchConnectionArgs = { after?: InputMaybe; @@ -966,19 +909,16 @@ export type QuerySearchConnectionArgs = { spaceId?: InputMaybe; }; - /** The root query type which gives access points into the data universe. */ export type QuerySpaceArgs = { id: Scalars['UUID']['input']; }; - /** The root query type which gives access points into the data universe. */ export type QuerySpaceByNodeIdArgs = { nodeId: Scalars['ID']['input']; }; - /** The root query type which gives access points into the data universe. */ export type QuerySpacesArgs = { condition?: InputMaybe; @@ -988,7 +928,6 @@ export type QuerySpacesArgs = { orderBy?: InputMaybe>; }; - /** The root query type which gives access points into the data universe. */ export type QuerySpacesConnectionArgs = { after?: InputMaybe; @@ -1001,13 +940,11 @@ export type QuerySpacesConnectionArgs = { orderBy?: InputMaybe>; }; - /** The root query type which gives access points into the data universe. */ export type QueryTypeArgs = { id?: InputMaybe; }; - /** The root query type which gives access points into the data universe. */ export type QueryTypesListArgs = { filter?: InputMaybe; @@ -1016,7 +953,6 @@ export type QueryTypesListArgs = { spaceId?: InputMaybe; }; - /** The root query type which gives access points into the data universe. */ export type QueryTypesListConnectionArgs = { after?: InputMaybe; @@ -1028,19 +964,16 @@ export type QueryTypesListConnectionArgs = { spaceId?: InputMaybe; }; - /** The root query type which gives access points into the data universe. */ export type QueryValueArgs = { id: Scalars['String']['input']; }; - /** The root query type which gives access points into the data universe. */ export type QueryValueByNodeIdArgs = { nodeId: Scalars['ID']['input']; }; - /** The root query type which gives access points into the data universe. */ export type QueryValuesArgs = { condition?: InputMaybe; @@ -1050,7 +983,6 @@ export type QueryValuesArgs = { orderBy?: InputMaybe>; }; - /** The root query type which gives access points into the data universe. */ export type QueryValuesConnectionArgs = { after?: InputMaybe; @@ -1212,7 +1144,6 @@ export type Space = Node & { valuesConnection: ValuesConnection; }; - export type SpaceEditorsArgs = { after?: InputMaybe; before?: InputMaybe; @@ -1224,7 +1155,6 @@ export type SpaceEditorsArgs = { orderBy?: InputMaybe>; }; - export type SpaceEditorsListArgs = { condition?: InputMaybe; filter?: InputMaybe; @@ -1233,7 +1163,6 @@ export type SpaceEditorsListArgs = { orderBy?: InputMaybe>; }; - export type SpaceMembersArgs = { after?: InputMaybe; before?: InputMaybe; @@ -1245,7 +1174,6 @@ export type SpaceMembersArgs = { orderBy?: InputMaybe>; }; - export type SpaceMembersListArgs = { condition?: InputMaybe; filter?: InputMaybe; @@ -1254,7 +1182,6 @@ export type SpaceMembersListArgs = { orderBy?: InputMaybe>; }; - export type SpaceRelationsArgs = { condition?: InputMaybe; filter?: InputMaybe; @@ -1263,7 +1190,6 @@ export type SpaceRelationsArgs = { orderBy?: InputMaybe>; }; - export type SpaceRelationsConnectionArgs = { after?: InputMaybe; before?: InputMaybe; @@ -1275,7 +1201,6 @@ export type SpaceRelationsConnectionArgs = { orderBy?: InputMaybe>; }; - export type SpaceValuesArgs = { condition?: InputMaybe; filter?: InputMaybe; @@ -1284,7 +1209,6 @@ export type SpaceValuesArgs = { orderBy?: InputMaybe>; }; - export type SpaceValuesConnectionArgs = { after?: InputMaybe; before?: InputMaybe; @@ -1370,9 +1294,7 @@ export type SpaceToManyValueFilter = { some?: InputMaybe; }; -export type SpaceTypes = - | 'PERSONAL' - | 'PUBLIC'; +export type SpaceTypes = 'PERSONAL' | 'PUBLIC'; /** A connection to a list of `Space` values. */ export type SpacesConnection = { @@ -1397,12 +1319,7 @@ export type SpacesEdge = { }; /** Methods to use when ordering `Space`. */ -export type SpacesOrderBy = - | 'ID_ASC' - | 'ID_DESC' - | 'NATURAL' - | 'PRIMARY_KEY_ASC' - | 'PRIMARY_KEY_DESC'; +export type SpacesOrderBy = 'ID_ASC' | 'ID_DESC' | 'NATURAL' | 'PRIMARY_KEY_ASC' | 'PRIMARY_KEY_DESC'; /** A filter to be used against String fields. All fields are combined with a logical ‘and.’ */ export type StringFilter = { @@ -1661,16 +1578,191 @@ export type SchemaBrowserTypesQueryVariables = Exact<{ first?: InputMaybe; }>; - -export type SchemaBrowserTypesQuery = { __typename?: 'Query', typesList?: Array<{ __typename?: 'Entity', id: string, name?: string | null, description?: string | null, properties?: Array<{ __typename?: 'Property', id: string, name?: string | null, dataType: DataTypes, relationValueTypes?: Array<{ __typename?: 'Entity', id: string, name?: string | null, description?: string | null, properties?: Array<{ __typename?: 'Property', id: string, name?: string | null, dataType: DataTypes }> | null }> | null }> | null }> | null }; +export type SchemaBrowserTypesQuery = { + __typename?: 'Query'; + typesList?: Array<{ + __typename?: 'Entity'; + id: string; + name?: string | null; + description?: string | null; + properties?: Array<{ + __typename?: 'Property'; + id: string; + name?: string | null; + dataType: DataTypes; + relationValueTypes?: Array<{ + __typename?: 'Entity'; + id: string; + name?: string | null; + description?: string | null; + properties?: Array<{ __typename?: 'Property'; id: string; name?: string | null; dataType: DataTypes }> | null; + }> | null; + }> | null; + }> | null; +}; export type PropertiesQueryVariables = Exact<{ first?: InputMaybe; }>; - -export type PropertiesQuery = { __typename?: 'Query', properties?: Array<{ __typename?: 'Property', id: string, name?: string | null, description?: string | null, dataType: DataTypes, relationValueTypes?: Array<{ __typename?: 'Entity', id: string, name?: string | null, description?: string | null, properties?: Array<{ __typename?: 'Property', id: string, dataType: DataTypes, name?: string | null }> | null }> | null }> | null }; - - -export const SchemaBrowserTypesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"SchemaBrowserTypes"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"first"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"typesList"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"first"},"value":{"kind":"Variable","name":{"kind":"Name","value":"first"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"dataType"}},{"kind":"Field","name":{"kind":"Name","value":"relationValueTypes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"dataType"}}]}}]}}]}}]}}]}}]} as unknown as DocumentNode; -export const PropertiesDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"Properties"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"first"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"Int"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"properties"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"first"},"value":{"kind":"Variable","name":{"kind":"Name","value":"first"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"dataType"}},{"kind":"Field","name":{"kind":"Name","value":"relationValueTypes"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"properties"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"dataType"}},{"kind":"Field","name":{"kind":"Name","value":"name"}}]}}]}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file +export type PropertiesQuery = { + __typename?: 'Query'; + properties?: Array<{ + __typename?: 'Property'; + id: string; + name?: string | null; + description?: string | null; + dataType: DataTypes; + relationValueTypes?: Array<{ + __typename?: 'Entity'; + id: string; + name?: string | null; + description?: string | null; + properties?: Array<{ __typename?: 'Property'; id: string; dataType: DataTypes; name?: string | null }> | null; + }> | null; + }> | null; +}; + +export const SchemaBrowserTypesDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'SchemaBrowserTypes' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { kind: 'Variable', name: { kind: 'Name', value: 'first' } }, + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'typesList' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'first' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'first' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'id' } }, + { kind: 'Field', name: { kind: 'Name', value: 'name' } }, + { kind: 'Field', name: { kind: 'Name', value: 'description' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'properties' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'id' } }, + { kind: 'Field', name: { kind: 'Name', value: 'name' } }, + { kind: 'Field', name: { kind: 'Name', value: 'dataType' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'relationValueTypes' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'id' } }, + { kind: 'Field', name: { kind: 'Name', value: 'name' } }, + { kind: 'Field', name: { kind: 'Name', value: 'description' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'properties' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'id' } }, + { kind: 'Field', name: { kind: 'Name', value: 'name' } }, + { kind: 'Field', name: { kind: 'Name', value: 'dataType' } }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; +export const PropertiesDocument = { + kind: 'Document', + definitions: [ + { + kind: 'OperationDefinition', + operation: 'query', + name: { kind: 'Name', value: 'Properties' }, + variableDefinitions: [ + { + kind: 'VariableDefinition', + variable: { kind: 'Variable', name: { kind: 'Name', value: 'first' } }, + type: { kind: 'NamedType', name: { kind: 'Name', value: 'Int' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { + kind: 'Field', + name: { kind: 'Name', value: 'properties' }, + arguments: [ + { + kind: 'Argument', + name: { kind: 'Name', value: 'first' }, + value: { kind: 'Variable', name: { kind: 'Name', value: 'first' } }, + }, + ], + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'id' } }, + { kind: 'Field', name: { kind: 'Name', value: 'name' } }, + { kind: 'Field', name: { kind: 'Name', value: 'description' } }, + { kind: 'Field', name: { kind: 'Name', value: 'dataType' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'relationValueTypes' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'id' } }, + { kind: 'Field', name: { kind: 'Name', value: 'name' } }, + { kind: 'Field', name: { kind: 'Name', value: 'description' } }, + { + kind: 'Field', + name: { kind: 'Name', value: 'properties' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'id' } }, + { kind: 'Field', name: { kind: 'Name', value: 'dataType' } }, + { kind: 'Field', name: { kind: 'Name', value: 'name' } }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], + }, + }, + ], +} as unknown as DocumentNode; diff --git a/apps/typesync/client/src/hooks/useSchemaBrowserQuery.tsx b/apps/typesync/client/src/hooks/useSchemaBrowserQuery.tsx index 801a8817..80f354d2 100644 --- a/apps/typesync/client/src/hooks/useSchemaBrowserQuery.tsx +++ b/apps/typesync/client/src/hooks/useSchemaBrowserQuery.tsx @@ -43,7 +43,7 @@ export async function fetchSchemaTypes(first = 100) { const Property = Schema.Struct({ id: Schema.UUID, - dataType: Schema.Literal('TEXT', 'NUMBER', 'CHECKBOX', 'TIME', 'POINT', 'RELATION'), + dataType: Schema.Literal('STRING', 'NUMBER', 'BOOLEAN', 'TIME', 'POINT', 'RELATION'), name: Schema.String, }); export const RelationValueType = Schema.Struct({ diff --git a/apps/typesync/client/src/routes/apps/create.tsx b/apps/typesync/client/src/routes/apps/create.tsx index ff435082..666a711a 100644 --- a/apps/typesync/client/src/routes/apps/create.tsx +++ b/apps/typesync/client/src/routes/apps/create.tsx @@ -36,7 +36,7 @@ const defaultValues: InsertAppSchema = { { name: '', knowledgeGraphId: null, - properties: [{ name: '', knowledgeGraphId: null, dataType: 'Text' }], + properties: [{ name: '', knowledgeGraphId: null, dataType: 'String' }], }, ], }; @@ -671,7 +671,7 @@ function CreateAppPage() { propsField.pushValue({ name: '', knowledgeGraphId: null, - dataType: 'Text', + dataType: 'String', } as never) } > @@ -702,7 +702,7 @@ function CreateAppPage() { field.pushValue({ name: '', knowledgeGraphId: null, - properties: [{ name: '', knowledgeGraphId: null, dataType: 'Text' }], + properties: [{ name: '', knowledgeGraphId: null, dataType: 'String' }], } as never) } > diff --git a/apps/typesync/client/src/utils/mapper.ts b/apps/typesync/client/src/utils/mapper.ts index 6cd2bfe8..988a626d 100644 --- a/apps/typesync/client/src/utils/mapper.ts +++ b/apps/typesync/client/src/utils/mapper.ts @@ -4,8 +4,8 @@ import type { DataTypes } from '../generated/graphql'; export function mapKGDataTypeToPrimitiveType(dataType: DataTypes, entity: string): SchemaDataType { switch (dataType) { - case 'CHECKBOX': { - return 'Checkbox'; + case 'BOOLEAN': { + return 'Boolean'; } case 'NUMBER': { return 'Number'; @@ -20,7 +20,7 @@ export function mapKGDataTypeToPrimitiveType(dataType: DataTypes, entity: string return `Relation(${entity})`; } default: { - return 'Text'; + return 'String'; } } } diff --git a/apps/typesync/domain/Domain.ts b/apps/typesync/domain/Domain.ts index e1454c2f..10540a31 100644 --- a/apps/typesync/domain/Domain.ts +++ b/apps/typesync/domain/Domain.ts @@ -37,7 +37,7 @@ export const InsertAppSchema = Schema.Struct({ { name: 'Account', knowledgeGraphId: null, - properties: [{ name: 'username', knowledgeGraphId: null, dataType: 'Text' }], + properties: [{ name: 'username', knowledgeGraphId: null, dataType: 'String' }], }, { name: 'Event', diff --git a/apps/typesync/package.json b/apps/typesync/package.json index 2882f4df..c3d6ddba 100644 --- a/apps/typesync/package.json +++ b/apps/typesync/package.json @@ -66,7 +66,7 @@ "vite": "^7.0.4" }, "dependencies": { - "@graphprotocol/grc-20": "^0.23.1", + "@graphprotocol/grc-20": "^0.24.1", "@graphprotocol/typesync": "^0.0.3", "@graphql-typed-document-node/core": "^3.2.0", "@headlessui/react": "^2.2.4", diff --git a/apps/typesync/src/Generator.ts b/apps/typesync/src/Generator.ts index 628c4ac4..c745ec62 100644 --- a/apps/typesync/src/Generator.ts +++ b/apps/typesync/src/Generator.ts @@ -311,12 +311,12 @@ function fieldToEntityString({ // Convert type to Entity type const entityType = (() => { switch (true) { - case dataType === 'Text': - return 'Type.Text'; + case dataType === 'String': + return 'Type.String'; case dataType === 'Number': return 'Type.Number'; - case dataType === 'Checkbox': - return 'Type.Checkbox'; + case dataType === 'Boolean': + return 'Type.Boolean'; case dataType === 'Date': return 'Type.Date'; case dataType === 'Point': @@ -326,7 +326,7 @@ function fieldToEntityString({ return `Type.${dataType}`; default: // how to handle complex types - return 'Type.Text'; + return 'Type.String'; } })(); // adds a tab before the property diff --git a/package.json b/package.json index 0fe4c5a3..d790a865 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "@babel/core": "^7.28.0", "@biomejs/biome": "^2.1.2", "@changesets/cli": "^2.29.5", - "@graphprotocol/grc-20": "^0.23.1", + "@graphprotocol/grc-20": "^0.24.1", "babel-plugin-annotate-pure-calls": "^0.5.0", "glob": "^11.0.3", "pkg-pr-new": "^0.0.54", diff --git a/packages/hypergraph-react/package.json b/packages/hypergraph-react/package.json index bc398264..e740fed9 100644 --- a/packages/hypergraph-react/package.json +++ b/packages/hypergraph-react/package.json @@ -47,7 +47,7 @@ "@automerge/automerge": "^2.2.9", "@automerge/automerge-repo": "^2.0.6", "@automerge/automerge-repo-react-hooks": "^2.0.6", - "@graphprotocol/grc-20": "^0.23.1", + "@graphprotocol/grc-20": "^0.24.1", "@noble/hashes": "^1.8.0", "@tanstack/react-query": "^5.75.5", "effect": "^3.17.3", diff --git a/packages/hypergraph-react/src/internal/use-create-entity-public.ts b/packages/hypergraph-react/src/internal/use-create-entity-public.ts index d6b7c261..8fde1901 100644 --- a/packages/hypergraph-react/src/internal/use-create-entity-public.ts +++ b/packages/hypergraph-react/src/internal/use-create-entity-public.ts @@ -41,7 +41,7 @@ export function useCreateEntityPublic( } let serializedValue: string = data[key]; if (TypeUtils.isBooleanOrOptionalBooleanType(fields[key])) { - serializedValue = Graph.serializeCheckbox(data[key]); + serializedValue = Graph.serializeBoolean(data[key]); } else if (TypeUtils.isDateOrOptionalDateType(fields[key])) { serializedValue = Graph.serializeDate(data[key]); } else if (TypeUtils.isPointOrOptionalPointType(fields[key])) { diff --git a/packages/hypergraph-react/src/internal/use-query-public.tsx b/packages/hypergraph-react/src/internal/use-query-public.tsx index c8a4018e..7acf1344 100644 --- a/packages/hypergraph-react/src/internal/use-query-public.tsx +++ b/packages/hypergraph-react/src/internal/use-query-public.tsx @@ -20,7 +20,11 @@ query entities($spaceId: UUID!, $typeIds: [UUID!]!, $first: Int) { name valuesList(filter: {spaceId: {is: $spaceId}}) { propertyId - value + string + boolean + number + time + point } } } @@ -36,7 +40,11 @@ query entities($spaceId: UUID!, $typeIds: [UUID!]!, $relationTypeIdsLevel1: [UUI name valuesList(filter: {spaceId: {is: $spaceId}}) { propertyId - value + string + boolean + number + time + point } relationsList( filter: {spaceId: {is: $spaceId}, typeId:{ in: $relationTypeIdsLevel1}}, @@ -46,7 +54,11 @@ query entities($spaceId: UUID!, $typeIds: [UUID!]!, $relationTypeIdsLevel1: [UUI name valuesList(filter: {spaceId: {is: $spaceId}}) { propertyId - value + string + boolean + number + time + point } } typeId @@ -65,7 +77,11 @@ query entities($spaceId: UUID!, $typeIds: [UUID!]!, $relationTypeIdsLevel1: [UUI name valuesList(filter: {spaceId: {is: $spaceId}}) { propertyId - value + string + boolean + number + time + point } relationsList( filter: {spaceId: {is: $spaceId}, typeId:{ in: $relationTypeIdsLevel1}}, @@ -75,7 +91,11 @@ query entities($spaceId: UUID!, $typeIds: [UUID!]!, $relationTypeIdsLevel1: [UUI name valuesList(filter: {spaceId: {is: $spaceId}}) { propertyId - value + string + boolean + number + time + point } relationsList( filter: {spaceId: {is: $spaceId}, typeId:{ in: $relationTypeIdsLevel2}}, @@ -86,7 +106,11 @@ query entities($spaceId: UUID!, $typeIds: [UUID!]!, $relationTypeIdsLevel1: [UUI name valuesList(filter: {spaceId: {is: $spaceId}}) { propertyId - value + string + boolean + number + time + point } } typeId @@ -104,7 +128,11 @@ type EntityQueryResult = { name: string; valuesList: { propertyId: string; - value: string; + string: string; + boolean: boolean; + number: number; + time: string; + point: string; }[]; relationsList: { toEntity: { @@ -112,7 +140,11 @@ type EntityQueryResult = { name: string; valuesList: { propertyId: string; - value: string; + string: string; + boolean: boolean; + number: number; + time: string; + point: string; }[]; relationsList: { toEntity: { @@ -120,7 +152,11 @@ type EntityQueryResult = { name: string; valuesList: { propertyId: string; - value: string; + string: string; + boolean: boolean; + number: number; + time: string; + point: string; }[]; }; typeId: string; @@ -140,7 +176,11 @@ type RecursiveQueryEntity = { name: string; valuesList?: { propertyId: string; - value: string; + string: string; + boolean: boolean; + number: number; + time: string; + point: string; }[]; relationsList?: { toEntity: RecursiveQueryEntity; @@ -149,23 +189,23 @@ type RecursiveQueryEntity = { }; const convertPropertyValue = ( - property: { propertyId: string; value: string }, + property: { propertyId: string; string: string; boolean: boolean; number: number; time: string; point: string }, key: string, type: Entity.AnyNoContext, ) => { - if (TypeUtils.isBooleanOrOptionalBooleanType(type.fields[key]) && property.value !== undefined) { - return Boolean(property.value); + if (TypeUtils.isBooleanOrOptionalBooleanType(type.fields[key]) && property.boolean !== undefined) { + return Boolean(property.boolean); } - if (TypeUtils.isPointOrOptionalPointType(type.fields[key]) && property.value !== undefined) { - return property.value; + if (TypeUtils.isPointOrOptionalPointType(type.fields[key]) && property.point !== undefined) { + return property.point; } - if (TypeUtils.isDateOrOptionalDateType(type.fields[key]) && property.value !== undefined) { - return property.value; + if (TypeUtils.isDateOrOptionalDateType(type.fields[key]) && property.time !== undefined) { + return property.time; } - if (TypeUtils.isNumberOrOptionalNumberType(type.fields[key]) && property.value !== undefined) { - return Number(property.value); + if (TypeUtils.isNumberOrOptionalNumberType(type.fields[key]) && property.number !== undefined) { + return Number(property.number); } - return property.value; + return property.string; }; const convertRelations = ( diff --git a/packages/hypergraph-react/src/prepare-publish.ts b/packages/hypergraph-react/src/prepare-publish.ts index d509b5d6..c0cb8afd 100644 --- a/packages/hypergraph-react/src/prepare-publish.ts +++ b/packages/hypergraph-react/src/prepare-publish.ts @@ -20,7 +20,11 @@ query entityToPublish($entityId: UUID!, $spaceId: UUID!) { entity(id: $entityId) { valuesList(filter: {spaceId: {is: $spaceId}}) { propertyId - value + string + boolean + number + time + point } relationsList(filter: {spaceId: {is: $spaceId}}) { id @@ -33,7 +37,11 @@ type EntityToPublishQueryResult = { entity: { valuesList: { propertyId: string; - value: string; + string: string; + boolean: boolean; + number: number; + time: string; + point: string; }[]; relationsList: { id: string; @@ -76,7 +84,7 @@ export const preparePublish = async ({ } let serializedValue: string = entity[key]; if (TypeUtils.isBooleanOrOptionalBooleanType(fields[key])) { - serializedValue = Graph.serializeCheckbox(entity[key]); + serializedValue = Graph.serializeBoolean(entity[key]); } else if (TypeUtils.isDateOrOptionalDateType(fields[key])) { serializedValue = Graph.serializeDate(entity[key]); } else if (TypeUtils.isPointOrOptionalPointType(fields[key])) { @@ -117,20 +125,27 @@ export const preparePublish = async ({ } throw new Error(`Value for ${key} is undefined`); } + + const existingValueEntry = data.entity.valuesList.find((value) => value.propertyId === propertyId); + let existingValue = existingValueEntry?.string; let serializedValue: string = entity[key]; if (TypeUtils.isBooleanOrOptionalBooleanType(fields[key])) { - serializedValue = Graph.serializeCheckbox(entity[key]); + existingValue = + existingValueEntry?.boolean !== undefined ? Graph.serializeBoolean(existingValueEntry.boolean) : undefined; + serializedValue = Graph.serializeBoolean(entity[key]); } else if (TypeUtils.isDateOrOptionalDateType(fields[key])) { + existingValue = existingValueEntry?.time; serializedValue = Graph.serializeDate(entity[key]); } else if (TypeUtils.isPointOrOptionalPointType(fields[key])) { + existingValue = existingValueEntry?.point; serializedValue = Graph.serializePoint(entity[key]); } else if (TypeUtils.isNumberOrOptionalNumberType(fields[key])) { + existingValue = + existingValueEntry?.number !== undefined ? Graph.serializeNumber(existingValueEntry.number) : undefined; serializedValue = Graph.serializeNumber(entity[key]); } - const existingValue = data.entity.valuesList.find((value) => value.propertyId === propertyId); - - if (serializedValue !== existingValue?.value) { + if (serializedValue !== existingValue) { values.push({ property: propertyId, value: serializedValue }); } } diff --git a/packages/hypergraph-react/test/prepare-publish.test.ts b/packages/hypergraph-react/test/prepare-publish.test.ts index b61b76b3..9977733d 100644 --- a/packages/hypergraph-react/test/prepare-publish.test.ts +++ b/packages/hypergraph-react/test/prepare-publish.test.ts @@ -248,7 +248,7 @@ describe('preparePublish', () => { valuesList: [ { propertyId: 'ed49ed7b-17b3-4df6-b0b5-11f78d82e151', value: 'Old Name' }, { propertyId: 'a427183d-3519-4c96-b80a-5a0c64daed41', value: Graph.serializeNumber(25) }, - { propertyId: 'e4259554-42b1-46e4-84c3-f8681987770f', value: Graph.serializeCheckbox(false) }, + { propertyId: 'e4259554-42b1-46e4-84c3-f8681987770f', value: Graph.serializeBoolean(false) }, ], relationsList: [], }, @@ -286,7 +286,7 @@ describe('preparePublish', () => { valuesList: [ { propertyId: 'ed49ed7b-17b3-4df6-b0b5-11f78d82e151', value: 'Same Name' }, { propertyId: 'a427183d-3519-4c96-b80a-5a0c64daed41', value: Graph.serializeNumber(30) }, - { propertyId: 'e4259554-42b1-46e4-84c3-f8681987770f', value: Graph.serializeCheckbox(true) }, + { propertyId: 'e4259554-42b1-46e4-84c3-f8681987770f', value: Graph.serializeBoolean(true) }, { propertyId: 'b5c0e2c7-9ac9-415e-8ffe-34f8b530f126', value: Graph.serializeDate(new Date('1993-01-01')) }, { propertyId: '45e707a5-4364-42fb-bb0b-927a5a8bc061', value: Graph.serializePoint([0, 0]) }, ], @@ -629,7 +629,7 @@ describe('preparePublish', () => { valuesList: [ { propertyId: '2a8b9c7d-4e5f-6a7b-8c9d-0e1f2a3b4c5d', value: 'Existing Entity' }, { propertyId: 'eaf9f4f8-5647-4228-aff5-8725368fc87c', value: Graph.serializeNumber(50) }, - { propertyId: '2742d8b6-3059-4adb-b439-fdfcd588dccb', value: Graph.serializeCheckbox(true) }, + { propertyId: '2742d8b6-3059-4adb-b439-fdfcd588dccb', value: Graph.serializeBoolean(true) }, ], relationsList: [], }, diff --git a/packages/hypergraph/package.json b/packages/hypergraph/package.json index f6849631..bf7c50d0 100644 --- a/packages/hypergraph/package.json +++ b/packages/hypergraph/package.json @@ -63,7 +63,7 @@ "@automerge/automerge": "^2.2.9", "@automerge/automerge-repo": "^2.0.6", "@effect/experimental": "^0.51.1", - "@graphprotocol/grc-20": "^0.23.1", + "@graphprotocol/grc-20": "^0.24.1", "@noble/ciphers": "^1.3.0", "@noble/curves": "^1.9.0", "@noble/hashes": "^1.8.0", diff --git a/packages/hypergraph/src/mapping/Mapping.ts b/packages/hypergraph/src/mapping/Mapping.ts index b8b84cc6..c0f376df 100644 --- a/packages/hypergraph/src/mapping/Mapping.ts +++ b/packages/hypergraph/src/mapping/Mapping.ts @@ -772,7 +772,7 @@ export class RelationValueTypeDoesNotExistError extends Data.TaggedError( export function mapSchemaDataTypeToGRC20PropDataType(dataType: SchemaDataType): CreatePropertyParams['dataType'] { switch (true) { case dataType === 'Boolean': { - return 'CHECKBOX'; + return 'BOOLEAN'; } case dataType === 'Date': { return 'TIME'; @@ -787,7 +787,7 @@ export function mapSchemaDataTypeToGRC20PropDataType(dataType: SchemaDataType): return 'RELATION'; } default: { - return 'TEXT'; + return 'STRING'; } } } diff --git a/packages/hypergraph/test/mapping/Mapping.test.ts b/packages/hypergraph/test/mapping/Mapping.test.ts index e476b390..f83bf25a 100644 --- a/packages/hypergraph/test/mapping/Mapping.test.ts +++ b/packages/hypergraph/test/mapping/Mapping.test.ts @@ -12,11 +12,11 @@ import { describe('Mapping', () => { describe('mapSchemaDataTypeToGRC20PropDataType', () => { it('should be able to map the schema dataType to the correct GRC-20 dataType', () => { - expect(mapSchemaDataTypeToGRC20PropDataType('Boolean')).toEqual('CHECKBOX'); + expect(mapSchemaDataTypeToGRC20PropDataType('Boolean')).toEqual('BOOLEAN'); expect(mapSchemaDataTypeToGRC20PropDataType('Number')).toEqual('NUMBER'); expect(mapSchemaDataTypeToGRC20PropDataType('Date')).toEqual('TIME'); expect(mapSchemaDataTypeToGRC20PropDataType('Point')).toEqual('POINT'); - expect(mapSchemaDataTypeToGRC20PropDataType('String')).toEqual('TEXT'); + expect(mapSchemaDataTypeToGRC20PropDataType('String')).toEqual('STRING'); expect(mapSchemaDataTypeToGRC20PropDataType('Relation(Event)')).toEqual('RELATION'); }); }); diff --git a/packages/typesync/package.json b/packages/typesync/package.json index d820e33d..6de3acbc 100644 --- a/packages/typesync/package.json +++ b/packages/typesync/package.json @@ -42,7 +42,7 @@ "test": "vitest" }, "dependencies": { - "@graphprotocol/grc-20": "^0.23.1", + "@graphprotocol/grc-20": "^0.24.1", "effect": "^3.17.3" } } diff --git a/packages/typesync/src/Mapping.ts b/packages/typesync/src/Mapping.ts index 6bc62aac..69434a36 100644 --- a/packages/typesync/src/Mapping.ts +++ b/packages/typesync/src/Mapping.ts @@ -94,7 +94,7 @@ export type SchemaDataTypeRelation = typeof SchemaDataTypeRelation.Type; /** * @since 0.0.1 */ -export const SchemaDataTypePrimitive = EffectSchema.Literal('Text', 'Number', 'Checkbox', 'Date', 'Point'); +export const SchemaDataTypePrimitive = EffectSchema.Literal('String', 'Number', 'Boolean', 'Date', 'Point'); /** * @since 0.0.1 */ @@ -195,7 +195,7 @@ export const Schema = EffectSchema.Struct({ { name: 'Account', knowledgeGraphId: null, - properties: [{ name: 'username', knowledgeGraphId: null, dataType: 'Text' }], + properties: [{ name: 'username', knowledgeGraphId: null, dataType: 'String' }], }, ], }, @@ -204,7 +204,7 @@ export const Schema = EffectSchema.Struct({ { name: 'Account', knowledgeGraphId: 'a5fd07b1-120f-46c6-b46f-387ef98396a6', - properties: [{ name: 'name', knowledgeGraphId: 'a126ca53-0c8e-48d5-b888-82c734c38935', dataType: 'Text' }], + properties: [{ name: 'name', knowledgeGraphId: 'a126ca53-0c8e-48d5-b888-82c734c38935', dataType: 'String' }], }, ], }, @@ -238,7 +238,7 @@ export const SchemaUnknownDecoder = EffectSchema.decodeUnknownSync(Schema); * properties: [ * { * name: "username", - * dataType: "Text", + * dataType: "String", * knowledgeGraphId: null * } * ] @@ -497,7 +497,7 @@ function processType(type: SchemaType, typeIdMap: TypeIdMapping): ProcessedType * properties: [ * { * name: "username", - * dataType: "Text", + * dataType: "String", * knowledgeGraphId: "994edcff-6996-4a77-9797-a13e5e3efad8" * }, * { @@ -513,12 +513,12 @@ function processType(type: SchemaType, typeIdMap: TypeIdMapping): ProcessedType * properties: [ * { * name: "name", - * dataType: "Text", + * dataType: "String", * knowledgeGraphId: "3808e060-fb4a-4d08-8069-35b8c8a1902b" * }, * { * name: "description", - * dataType: "Text", + * dataType: "String", * knowledgeGraphId: null * }, * { @@ -558,7 +558,7 @@ function processType(type: SchemaType, typeIdMap: TypeIdMapping): ProcessedType * type: "CREATE_PROPERTY", * property: { * id: Id("8cd7d9ac-a878-4287-8000-e71e6f853117"), - * dataType: "TEXT" + * dataType: "String" * } * }, * // Graph.createProperty Op for Event.description property @@ -566,7 +566,7 @@ function processType(type: SchemaType, typeIdMap: TypeIdMapping): ProcessedType * type: "CREATE_PROPERTY", * property: { * id: Id("8fc4e17c-7581-4d6c-a712-943385afc7b5"), - * dataType: "TEXT" + * dataType: "String" * } * }, * // Graph.createProperty Op for Event.speaker property @@ -749,8 +749,8 @@ export class RelationValueTypeDoesNotExistError extends Data.TaggedError( */ export function mapSchemaDataTypeToGRC20PropDataType(dataType: SchemaDataType): CreatePropertyParams['dataType'] { switch (true) { - case dataType === 'Checkbox': { - return 'CHECKBOX'; + case dataType === 'Boolean': { + return 'BOOLEAN'; } case dataType === 'Date': { return 'TIME'; @@ -765,7 +765,7 @@ export function mapSchemaDataTypeToGRC20PropDataType(dataType: SchemaDataType): return 'RELATION'; } default: { - return 'TEXT'; + return 'STRING'; } } } diff --git a/packages/typesync/test/Mapping.test.ts b/packages/typesync/test/Mapping.test.ts index 89722406..7756d51b 100644 --- a/packages/typesync/test/Mapping.test.ts +++ b/packages/typesync/test/Mapping.test.ts @@ -12,12 +12,11 @@ import { describe('Mapping', () => { describe('mapSchemaDataTypeToGRC20PropDataType', () => { it('should be able to map the schema dataType to the correct GRC-20 dataType', () => { - expect(mapSchemaDataTypeToGRC20PropDataType('Checkbox')).toEqual('CHECKBOX'); + expect(mapSchemaDataTypeToGRC20PropDataType('Boolean')).toEqual('BOOLEAN'); expect(mapSchemaDataTypeToGRC20PropDataType('Number')).toEqual('NUMBER'); expect(mapSchemaDataTypeToGRC20PropDataType('Date')).toEqual('TIME'); expect(mapSchemaDataTypeToGRC20PropDataType('Point')).toEqual('POINT'); - expect(mapSchemaDataTypeToGRC20PropDataType('Url')).toEqual('TEXT'); - expect(mapSchemaDataTypeToGRC20PropDataType('Text')).toEqual('TEXT'); + expect(mapSchemaDataTypeToGRC20PropDataType('String')).toEqual('STRING'); expect(mapSchemaDataTypeToGRC20PropDataType('Relation(Event)')).toEqual('RELATION'); }); }); @@ -28,7 +27,7 @@ describe('Mapping', () => { { name: 'Account', knowledgeGraphId: null, - properties: [{ name: 'username', dataType: 'Text', knowledgeGraphId: null }], + properties: [{ name: 'username', dataType: 'String', knowledgeGraphId: null }], }, { name: 'Event', @@ -66,7 +65,7 @@ describe('Mapping', () => { properties: [ { name: 'username', - dataType: 'Text', + dataType: 'String', knowledgeGraphId: null, }, { @@ -82,12 +81,12 @@ describe('Mapping', () => { properties: [ { name: 'name', - dataType: 'Text', + dataType: 'String', knowledgeGraphId: null, }, { name: 'description', - dataType: 'Text', + dataType: 'String', knowledgeGraphId: null, }, { @@ -131,7 +130,7 @@ describe('Mapping', () => { properties: [ { name: 'username', - dataType: 'Text', + dataType: 'String', knowledgeGraphId: '994edcff-6996-4a77-9797-a13e5e3efad8', }, { @@ -147,12 +146,12 @@ describe('Mapping', () => { properties: [ { name: 'name', - dataType: 'Text', + dataType: 'String', knowledgeGraphId: '3808e060-fb4a-4d08-8069-35b8c8a1902b', }, { name: 'description', - dataType: 'Text', + dataType: 'String', knowledgeGraphId: null, }, { @@ -196,7 +195,7 @@ describe('Mapping', () => { properties: [ { name: 'username', - dataType: 'Text', + dataType: 'String', knowledgeGraphId: null, }, ], @@ -207,7 +206,7 @@ describe('Mapping', () => { properties: [ { name: 'name', - dataType: 'Text', + dataType: 'String', knowledgeGraphId: null, }, { @@ -249,7 +248,7 @@ describe('Mapping', () => { properties: [ { name: 'username', - dataType: 'Text', + dataType: 'String', knowledgeGraphId: null, }, ], @@ -260,7 +259,7 @@ describe('Mapping', () => { properties: [ { name: 'name', - dataType: 'Text', + dataType: 'String', knowledgeGraphId: null, }, { @@ -302,7 +301,7 @@ describe('Mapping', () => { properties: [ { name: 'username', - dataType: 'Text', + dataType: 'String', knowledgeGraphId: '994edcff-6996-4a77-9797-a13e5e3efad8', }, ], @@ -313,7 +312,7 @@ describe('Mapping', () => { properties: [ { name: 'name', - dataType: 'Text', + dataType: 'String', knowledgeGraphId: null, }, { @@ -329,7 +328,7 @@ describe('Mapping', () => { properties: [ { name: 'title', - dataType: 'Text', + dataType: 'String', knowledgeGraphId: null, }, { @@ -384,12 +383,12 @@ describe('Mapping', () => { { name: 'Account', knowledgeGraphId: null, - properties: [{ name: 'username', dataType: 'Text', knowledgeGraphId: null }], + properties: [{ name: 'username', dataType: 'String', knowledgeGraphId: null }], }, { name: 'Account', knowledgeGraphId: null, - properties: [{ name: 'image', dataType: 'Text', knowledgeGraphId: null }], + properties: [{ name: 'image', dataType: 'String', knowledgeGraphId: null }], }, ], }), @@ -403,8 +402,8 @@ describe('Mapping', () => { name: 'Account', knowledgeGraphId: null, properties: [ - { name: 'username', dataType: 'Text', knowledgeGraphId: null }, - { name: 'username', dataType: 'Text', knowledgeGraphId: null }, + { name: 'username', dataType: 'String', knowledgeGraphId: null }, + { name: 'username', dataType: 'String', knowledgeGraphId: null }, ], }, ], diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 12dba07c..5f510b7f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -21,8 +21,8 @@ importers: specifier: ^2.29.5 version: 2.29.5 '@graphprotocol/grc-20': - specifier: ^0.23.1 - version: 0.23.1(bufferutil@4.0.9)(ox@0.6.9(typescript@5.8.3)(zod@3.25.51))(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.51) + specifier: ^0.24.1 + version: 0.24.1(bufferutil@4.0.9)(ox@0.6.9(typescript@5.8.3)(zod@3.25.51))(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.51) babel-plugin-annotate-pure-calls: specifier: ^0.5.0 version: 0.5.0(@babel/core@7.28.0) @@ -45,8 +45,8 @@ importers: specifier: 1.0.0-beta.1 version: 1.0.0-beta.1(@types/react@19.1.3)(react-dom@19.1.0(react@19.1.0))(react@19.1.0) '@graphprotocol/grc-20': - specifier: ^0.23.1 - version: 0.23.1(bufferutil@4.0.9)(ox@0.6.9(typescript@5.8.3)(zod@3.25.51))(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.51) + specifier: ^0.24.1 + version: 0.24.1(bufferutil@4.0.9)(ox@0.6.9(typescript@5.8.3)(zod@3.25.51))(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.51) '@graphprotocol/hypergraph': specifier: workspace:* version: link:../../packages/hypergraph/publish @@ -175,8 +175,8 @@ importers: apps/create-hypergraph/template-nextjs: dependencies: '@graphprotocol/grc-20': - specifier: ^0.23.1 - version: 0.23.1(bufferutil@4.0.9)(ox@0.6.9(typescript@5.8.3)(zod@3.25.51))(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.51) + specifier: ^0.24.1 + version: 0.24.1(bufferutil@4.0.9)(ox@0.6.9(typescript@5.8.3)(zod@3.25.51))(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.51) '@graphprotocol/hypergraph': specifier: workspace:* version: link:../../../packages/hypergraph/publish @@ -254,8 +254,8 @@ importers: apps/create-hypergraph/template-vite-react: dependencies: '@graphprotocol/grc-20': - specifier: ^0.23.1 - version: 0.23.1(bufferutil@4.0.9)(ox@0.6.9(typescript@5.8.3)(zod@3.25.51))(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.51) + specifier: ^0.24.1 + version: 0.24.1(bufferutil@4.0.9)(ox@0.6.9(typescript@5.8.3)(zod@3.25.51))(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.51) '@graphprotocol/hypergraph': specifier: workspace:* version: link:../../../packages/hypergraph/publish @@ -354,8 +354,8 @@ importers: apps/events: dependencies: '@graphprotocol/grc-20': - specifier: ^0.23.1 - version: 0.23.1(bufferutil@4.0.9)(ox@0.6.9(typescript@5.8.3)(zod@3.25.51))(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.51) + specifier: ^0.24.1 + version: 0.24.1(bufferutil@4.0.9)(ox@0.6.9(typescript@5.8.3)(zod@3.25.51))(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.51) '@graphprotocol/hypergraph': specifier: workspace:* version: link:../../packages/hypergraph/publish @@ -472,8 +472,8 @@ importers: apps/next-example: dependencies: '@graphprotocol/grc-20': - specifier: ^0.23.1 - version: 0.23.1(bufferutil@4.0.9)(ox@0.6.9(typescript@5.8.3)(zod@3.25.51))(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.51) + specifier: ^0.24.1 + version: 0.24.1(bufferutil@4.0.9)(ox@0.6.9(typescript@5.8.3)(zod@3.25.51))(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.51) '@graphprotocol/hypergraph': specifier: workspace:* version: link:../../packages/hypergraph/publish @@ -576,8 +576,8 @@ importers: apps/typesync: dependencies: '@graphprotocol/grc-20': - specifier: ^0.23.1 - version: 0.23.1(bufferutil@4.0.9)(ox@0.6.7(typescript@5.8.3)(zod@3.25.51))(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.51) + specifier: ^0.24.1 + version: 0.24.1(bufferutil@4.0.9)(ox@0.6.7(typescript@5.8.3)(zod@3.25.51))(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.51) '@graphprotocol/typesync': specifier: ^0.0.3 version: 0.0.3(bufferutil@4.0.9)(graphql@16.11.0)(ox@0.6.7(typescript@5.8.3)(zod@3.25.51))(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.51) @@ -719,81 +719,6 @@ importers: version: 7.0.4(@types/node@24.1.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.39.1)(tsx@4.20.3)(yaml@2.7.0) publishDirectory: dist - apps/typesync/dist: - dependencies: - '@graphprotocol/grc-20': - specifier: ^0.23.1 - version: 0.23.1(bufferutil@4.0.9)(ox@0.6.7(typescript@5.8.3)(zod@3.25.51))(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.51) - '@graphprotocol/typesync': - specifier: ^0.0.3 - version: 0.0.3(bufferutil@4.0.9)(graphql@16.11.0)(ox@0.6.7(typescript@5.8.3)(zod@3.25.51))(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.51) - '@graphql-typed-document-node/core': - specifier: ^3.2.0 - version: 3.2.0(graphql@16.11.0) - '@headlessui/react': - specifier: ^2.2.4 - version: 2.2.4(react-dom@19.1.0(react@19.1.0))(react@19.1.0) - '@heroicons/react': - specifier: ^2.2.0 - version: 2.2.0(react@19.1.0) - '@phosphor-icons/react': - specifier: ^2.1.10 - version: 2.1.10(react-dom@19.1.0(react@19.1.0))(react@19.1.0) - '@radix-ui/react-tabs': - specifier: ^1.1.12 - version: 1.1.12(@types/react-dom@19.1.6(@types/react@19.1.9))(@types/react@19.1.9)(react-dom@19.1.0(react@19.1.0))(react@19.1.0) - '@tailwindcss/vite': - specifier: ^4.1.11 - version: 4.1.11(vite@7.0.5(@types/node@24.1.0)(jiti@2.5.1)(lightningcss@1.30.1)(terser@5.39.1)(tsx@4.20.3)(yaml@2.7.0)) - '@tanstack/react-form': - specifier: ^1.14.1 - version: 1.14.1(react-dom@19.1.0(react@19.1.0))(react@19.1.0) - '@tanstack/react-query': - specifier: ^5.83.0 - version: 5.83.0(react@19.1.0) - '@tanstack/react-query-devtools': - specifier: ^5.83.0 - version: 5.83.0(@tanstack/react-query@5.83.0(react@19.1.0))(react@19.1.0) - '@tanstack/react-router': - specifier: ^1.129.5 - version: 1.129.5(react-dom@19.1.0(react@19.1.0))(react@19.1.0) - '@tanstack/react-router-devtools': - specifier: ^1.129.5 - version: 1.129.5(@tanstack/react-router@1.129.5(react-dom@19.1.0(react@19.1.0))(react@19.1.0))(@tanstack/router-core@1.129.6)(csstype@3.1.3)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)(solid-js@1.9.5)(tiny-invariant@1.3.3) - better-sqlite3: - specifier: ^12.2.0 - version: 12.2.0 - date-fns: - specifier: ^4.1.0 - version: 4.1.0 - effect: - specifier: ^3.17.1 - version: 3.17.3 - graphql: - specifier: ^16.11.0 - version: 16.11.0 - graphql-request: - specifier: ^7.2.0 - version: 7.2.0(graphql@16.11.0) - jotai: - specifier: ^2.12.5 - version: 2.12.5(@types/react@19.1.9)(react@19.1.0) - open: - specifier: ^10.2.0 - version: 10.2.0 - react: - specifier: ^19.1.0 - version: 19.1.0 - react-dom: - specifier: ^19.1.0 - version: 19.1.0(react@19.1.0) - shiki: - specifier: ^3.8.0 - version: 3.8.0 - tailwindcss: - specifier: ^4.1.11 - version: 4.1.11 - docs: dependencies: '@docusaurus/core': @@ -840,8 +765,8 @@ importers: specifier: ^0.51.1 version: 0.51.1(@effect/platform@0.90.0(effect@3.17.3))(effect@3.17.3) '@graphprotocol/grc-20': - specifier: ^0.23.1 - version: 0.23.1(bufferutil@4.0.9)(ox@0.6.7(typescript@5.8.3)(zod@3.25.51))(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.51) + specifier: ^0.24.1 + version: 0.24.1(bufferutil@4.0.9)(ox@0.6.7(typescript@5.8.3)(zod@3.25.51))(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.51) '@noble/ciphers': specifier: ^1.3.0 version: 1.3.0 @@ -923,8 +848,8 @@ importers: specifier: ^2.0.6 version: 2.0.6(react-dom@19.1.0(react@19.1.0))(react@19.1.0) '@graphprotocol/grc-20': - specifier: ^0.23.1 - version: 0.23.1(bufferutil@4.0.9)(ox@0.6.9(typescript@5.8.3)(zod@3.25.51))(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.51) + specifier: ^0.24.1 + version: 0.24.1(bufferutil@4.0.9)(ox@0.6.9(typescript@5.8.3)(zod@3.25.51))(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.51) '@noble/hashes': specifier: ^1.8.0 version: 1.8.0 @@ -976,8 +901,8 @@ importers: packages/typesync: dependencies: '@graphprotocol/grc-20': - specifier: ^0.23.1 - version: 0.23.1(bufferutil@4.0.9)(ox@0.6.9(typescript@5.8.3)(zod@3.25.51))(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.51) + specifier: ^0.24.1 + version: 0.24.1(bufferutil@4.0.9)(ox@0.6.9(typescript@5.8.3)(zod@3.25.51))(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.51) effect: specifier: ^3.17.3 version: 3.17.3 @@ -3177,8 +3102,8 @@ packages: '@graphprotocol/grc-20@0.21.6': resolution: {integrity: sha512-xN8kejQfRdeC5LsantOD9aajwR+/JHnsK5IUEE7rMJbbHGeRTzAhWGike8k1+nIPRKooOyrocgly24KXxChcgw==} - '@graphprotocol/grc-20@0.23.1': - resolution: {integrity: sha512-6x35ZJUYyPtmUnukthZdMcaQ80bLalNg8GPLxA73PLGTvCmYCjdr9HbzHVxPsoTqS584In1TwfWXAzgIXNIdLw==} + '@graphprotocol/grc-20@0.24.1': + resolution: {integrity: sha512-oP8E4GmqSIM3hYzRTIhPtUS0Szg1wdzo1AUtLTTZazWoUycMm+K2FgfwANpN7q3CzOyuVtBeEhmdogw74q/0jw==} '@graphprotocol/typesync@0.0.3': resolution: {integrity: sha512-8+agAOyyftY7itiQgXHkcKZy+n98xvzpcf6AfygUb4FY7GSpmRl8BX/gTn2Wu8gIigr7AZyL6NFnSpBrSr7OPQ==} @@ -7940,8 +7865,8 @@ packages: effect@3.17.3: resolution: {integrity: sha512-FbFMr6xBXPII5Od8QJnkHz+2GTmQgq+8NPQev6C2k9cf1lcUjQ4vpw1kjbMc2X0UkjIkIWe0EtNK2RV6bl34UQ==} - effect@3.17.4: - resolution: {integrity: sha512-VD+5bYdIN088c1fCESqYvOKQ22O2dUptO+Chy7SGMqthIVcYBvVlYSgUQT976XJaHOV2Fd0TaW94EYWHOQsbOw==} + effect@3.17.6: + resolution: {integrity: sha512-BDVr3TEI6JpTnsZwDzXlzxDtyMS0cwtfWmhqfL3nl7Be/443+geFYAlVpCy7SCkLCck0NbmFX86LtlCZtCgdxA==} electron-to-chromium@1.5.152: resolution: {integrity: sha512-xBOfg/EBaIlVsHipHl2VdTPJRSvErNUaqW8ejTq5OlOlIYx1wOllCHsAvAIrr55jD1IYEfdR86miUEt8H5IeJg==} @@ -17310,10 +17235,10 @@ snapshots: - utf-8-validate - zod - '@graphprotocol/grc-20@0.23.1(bufferutil@4.0.9)(ox@0.6.7(typescript@5.8.3)(zod@3.25.51))(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.51)': + '@graphprotocol/grc-20@0.24.1(bufferutil@4.0.9)(ox@0.6.7(typescript@5.8.3)(zod@3.25.51))(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.51)': dependencies: '@bufbuild/protobuf': 1.10.1 - effect: 3.17.4 + effect: 3.17.6 fflate: 0.8.2 fractional-indexing-jittered: 1.0.0 image-size: 2.0.2 @@ -17327,10 +17252,10 @@ snapshots: - utf-8-validate - zod - '@graphprotocol/grc-20@0.23.1(bufferutil@4.0.9)(ox@0.6.9(typescript@5.8.3)(zod@3.25.51))(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.51)': + '@graphprotocol/grc-20@0.24.1(bufferutil@4.0.9)(ox@0.6.9(typescript@5.8.3)(zod@3.25.51))(typescript@5.8.3)(utf-8-validate@5.0.10)(zod@3.25.51)': dependencies: '@bufbuild/protobuf': 1.10.1 - effect: 3.17.4 + effect: 3.17.6 fflate: 0.8.2 fractional-indexing-jittered: 1.0.0 image-size: 2.0.2 @@ -18806,18 +18731,6 @@ snapshots: '@types/react': 19.1.8 '@types/react-dom': 19.1.6(@types/react@19.1.8) - '@radix-ui/react-collection@1.1.7(@types/react-dom@19.1.6(@types/react@19.1.9))(@types/react@19.1.9)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)': - dependencies: - '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.1.9)(react@19.1.0) - '@radix-ui/react-context': 1.1.2(@types/react@19.1.9)(react@19.1.0) - '@radix-ui/react-primitive': 2.1.3(@types/react-dom@19.1.6(@types/react@19.1.9))(@types/react@19.1.9)(react-dom@19.1.0(react@19.1.0))(react@19.1.0) - '@radix-ui/react-slot': 1.2.3(@types/react@19.1.9)(react@19.1.0) - react: 19.1.0 - react-dom: 19.1.0(react@19.1.0) - optionalDependencies: - '@types/react': 19.1.9 - '@types/react-dom': 19.1.6(@types/react@19.1.9) - '@radix-ui/react-compose-refs@1.1.2(@types/react@19.1.3)(react@19.1.0)': dependencies: react: 19.1.0 @@ -18830,12 +18743,6 @@ snapshots: optionalDependencies: '@types/react': 19.1.8 - '@radix-ui/react-compose-refs@1.1.2(@types/react@19.1.9)(react@19.1.0)': - dependencies: - react: 19.1.0 - optionalDependencies: - '@types/react': 19.1.9 - '@radix-ui/react-context@1.1.2(@types/react@19.1.3)(react@19.1.0)': dependencies: react: 19.1.0 @@ -18848,24 +18755,12 @@ snapshots: optionalDependencies: '@types/react': 19.1.8 - '@radix-ui/react-context@1.1.2(@types/react@19.1.9)(react@19.1.0)': - dependencies: - react: 19.1.0 - optionalDependencies: - '@types/react': 19.1.9 - '@radix-ui/react-direction@1.1.1(@types/react@19.1.8)(react@19.1.0)': dependencies: react: 19.1.0 optionalDependencies: '@types/react': 19.1.8 - '@radix-ui/react-direction@1.1.1(@types/react@19.1.9)(react@19.1.0)': - dependencies: - react: 19.1.0 - optionalDependencies: - '@types/react': 19.1.9 - '@radix-ui/react-dismissable-layer@1.1.10(@types/react-dom@19.1.6(@types/react@19.1.8))(@types/react@19.1.8)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)': dependencies: '@radix-ui/primitive': 1.1.2 @@ -18890,13 +18785,6 @@ snapshots: optionalDependencies: '@types/react': 19.1.8 - '@radix-ui/react-id@1.1.1(@types/react@19.1.9)(react@19.1.0)': - dependencies: - '@radix-ui/react-use-layout-effect': 1.1.1(@types/react@19.1.9)(react@19.1.0) - react: 19.1.0 - optionalDependencies: - '@types/react': 19.1.9 - '@radix-ui/react-label@2.1.7(@types/react-dom@19.1.3(@types/react@19.1.3))(@types/react@19.1.3)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)': dependencies: '@radix-ui/react-primitive': 2.1.3(@types/react-dom@19.1.3(@types/react@19.1.3))(@types/react@19.1.3)(react-dom@19.1.0(react@19.1.0))(react@19.1.0) @@ -18966,16 +18854,6 @@ snapshots: '@types/react': 19.1.8 '@types/react-dom': 19.1.6(@types/react@19.1.8) - '@radix-ui/react-presence@1.1.4(@types/react-dom@19.1.6(@types/react@19.1.9))(@types/react@19.1.9)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)': - dependencies: - '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.1.9)(react@19.1.0) - '@radix-ui/react-use-layout-effect': 1.1.1(@types/react@19.1.9)(react@19.1.0) - react: 19.1.0 - react-dom: 19.1.0(react@19.1.0) - optionalDependencies: - '@types/react': 19.1.9 - '@types/react-dom': 19.1.6(@types/react@19.1.9) - '@radix-ui/react-primitive@2.1.2(@types/react-dom@19.1.3(@types/react@19.1.3))(@types/react@19.1.3)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)': dependencies: '@radix-ui/react-slot': 1.2.2(@types/react@19.1.3)(react@19.1.0) @@ -19003,15 +18881,6 @@ snapshots: '@types/react': 19.1.8 '@types/react-dom': 19.1.6(@types/react@19.1.8) - '@radix-ui/react-primitive@2.1.3(@types/react-dom@19.1.6(@types/react@19.1.9))(@types/react@19.1.9)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)': - dependencies: - '@radix-ui/react-slot': 1.2.3(@types/react@19.1.9)(react@19.1.0) - react: 19.1.0 - react-dom: 19.1.0(react@19.1.0) - optionalDependencies: - '@types/react': 19.1.9 - '@types/react-dom': 19.1.6(@types/react@19.1.9) - '@radix-ui/react-roving-focus@1.1.10(@types/react-dom@19.1.6(@types/react@19.1.8))(@types/react@19.1.8)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)': dependencies: '@radix-ui/primitive': 1.1.2 @@ -19029,23 +18898,6 @@ snapshots: '@types/react': 19.1.8 '@types/react-dom': 19.1.6(@types/react@19.1.8) - '@radix-ui/react-roving-focus@1.1.10(@types/react-dom@19.1.6(@types/react@19.1.9))(@types/react@19.1.9)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)': - dependencies: - '@radix-ui/primitive': 1.1.2 - '@radix-ui/react-collection': 1.1.7(@types/react-dom@19.1.6(@types/react@19.1.9))(@types/react@19.1.9)(react-dom@19.1.0(react@19.1.0))(react@19.1.0) - '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.1.9)(react@19.1.0) - '@radix-ui/react-context': 1.1.2(@types/react@19.1.9)(react@19.1.0) - '@radix-ui/react-direction': 1.1.1(@types/react@19.1.9)(react@19.1.0) - '@radix-ui/react-id': 1.1.1(@types/react@19.1.9)(react@19.1.0) - '@radix-ui/react-primitive': 2.1.3(@types/react-dom@19.1.6(@types/react@19.1.9))(@types/react@19.1.9)(react-dom@19.1.0(react@19.1.0))(react@19.1.0) - '@radix-ui/react-use-callback-ref': 1.1.1(@types/react@19.1.9)(react@19.1.0) - '@radix-ui/react-use-controllable-state': 1.2.2(@types/react@19.1.9)(react@19.1.0) - react: 19.1.0 - react-dom: 19.1.0(react@19.1.0) - optionalDependencies: - '@types/react': 19.1.9 - '@types/react-dom': 19.1.6(@types/react@19.1.9) - '@radix-ui/react-slot@1.2.2(@types/react@19.1.3)(react@19.1.0)': dependencies: '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.1.3)(react@19.1.0) @@ -19067,13 +18919,6 @@ snapshots: optionalDependencies: '@types/react': 19.1.8 - '@radix-ui/react-slot@1.2.3(@types/react@19.1.9)(react@19.1.0)': - dependencies: - '@radix-ui/react-compose-refs': 1.1.2(@types/react@19.1.9)(react@19.1.0) - react: 19.1.0 - optionalDependencies: - '@types/react': 19.1.9 - '@radix-ui/react-tabs@1.1.12(@types/react-dom@19.1.6(@types/react@19.1.8))(@types/react@19.1.8)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)': dependencies: '@radix-ui/primitive': 1.1.2 @@ -19090,22 +18935,6 @@ snapshots: '@types/react': 19.1.8 '@types/react-dom': 19.1.6(@types/react@19.1.8) - '@radix-ui/react-tabs@1.1.12(@types/react-dom@19.1.6(@types/react@19.1.9))(@types/react@19.1.9)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)': - dependencies: - '@radix-ui/primitive': 1.1.2 - '@radix-ui/react-context': 1.1.2(@types/react@19.1.9)(react@19.1.0) - '@radix-ui/react-direction': 1.1.1(@types/react@19.1.9)(react@19.1.0) - '@radix-ui/react-id': 1.1.1(@types/react@19.1.9)(react@19.1.0) - '@radix-ui/react-presence': 1.1.4(@types/react-dom@19.1.6(@types/react@19.1.9))(@types/react@19.1.9)(react-dom@19.1.0(react@19.1.0))(react@19.1.0) - '@radix-ui/react-primitive': 2.1.3(@types/react-dom@19.1.6(@types/react@19.1.9))(@types/react@19.1.9)(react-dom@19.1.0(react@19.1.0))(react@19.1.0) - '@radix-ui/react-roving-focus': 1.1.10(@types/react-dom@19.1.6(@types/react@19.1.9))(@types/react@19.1.9)(react-dom@19.1.0(react@19.1.0))(react@19.1.0) - '@radix-ui/react-use-controllable-state': 1.2.2(@types/react@19.1.9)(react@19.1.0) - react: 19.1.0 - react-dom: 19.1.0(react@19.1.0) - optionalDependencies: - '@types/react': 19.1.9 - '@types/react-dom': 19.1.6(@types/react@19.1.9) - '@radix-ui/react-tooltip@1.2.7(@types/react-dom@19.1.6(@types/react@19.1.8))(@types/react@19.1.8)(react-dom@19.1.0(react@19.1.0))(react@19.1.0)': dependencies: '@radix-ui/primitive': 1.1.2 @@ -19138,12 +18967,6 @@ snapshots: optionalDependencies: '@types/react': 19.1.8 - '@radix-ui/react-use-callback-ref@1.1.1(@types/react@19.1.9)(react@19.1.0)': - dependencies: - react: 19.1.0 - optionalDependencies: - '@types/react': 19.1.9 - '@radix-ui/react-use-controllable-state@1.2.2(@types/react@19.1.8)(react@19.1.0)': dependencies: '@radix-ui/react-use-effect-event': 0.0.2(@types/react@19.1.8)(react@19.1.0) @@ -19152,14 +18975,6 @@ snapshots: optionalDependencies: '@types/react': 19.1.8 - '@radix-ui/react-use-controllable-state@1.2.2(@types/react@19.1.9)(react@19.1.0)': - dependencies: - '@radix-ui/react-use-effect-event': 0.0.2(@types/react@19.1.9)(react@19.1.0) - '@radix-ui/react-use-layout-effect': 1.1.1(@types/react@19.1.9)(react@19.1.0) - react: 19.1.0 - optionalDependencies: - '@types/react': 19.1.9 - '@radix-ui/react-use-effect-event@0.0.2(@types/react@19.1.8)(react@19.1.0)': dependencies: '@radix-ui/react-use-layout-effect': 1.1.1(@types/react@19.1.8)(react@19.1.0) @@ -19167,13 +18982,6 @@ snapshots: optionalDependencies: '@types/react': 19.1.8 - '@radix-ui/react-use-effect-event@0.0.2(@types/react@19.1.9)(react@19.1.0)': - dependencies: - '@radix-ui/react-use-layout-effect': 1.1.1(@types/react@19.1.9)(react@19.1.0) - react: 19.1.0 - optionalDependencies: - '@types/react': 19.1.9 - '@radix-ui/react-use-escape-keydown@1.1.1(@types/react@19.1.8)(react@19.1.0)': dependencies: '@radix-ui/react-use-callback-ref': 1.1.1(@types/react@19.1.8)(react@19.1.0) @@ -19200,12 +19008,6 @@ snapshots: optionalDependencies: '@types/react': 19.1.8 - '@radix-ui/react-use-layout-effect@1.1.1(@types/react@19.1.9)(react@19.1.0)': - dependencies: - react: 19.1.0 - optionalDependencies: - '@types/react': 19.1.9 - '@radix-ui/react-use-previous@1.1.1(@types/react@19.1.8)(react@19.1.0)': dependencies: react: 19.1.0 @@ -20844,11 +20646,6 @@ snapshots: dependencies: '@types/react': 19.1.8 - '@types/react-dom@19.1.6(@types/react@19.1.9)': - dependencies: - '@types/react': 19.1.9 - optional: true - '@types/react-router-config@5.0.11': dependencies: '@types/history': 4.7.11 @@ -23458,7 +23255,7 @@ snapshots: '@standard-schema/spec': 1.0.0 fast-check: 3.23.2 - effect@3.17.4: + effect@3.17.6: dependencies: '@standard-schema/spec': 1.0.0 fast-check: 3.23.2 @@ -25456,11 +25253,6 @@ snapshots: '@types/react': 19.1.8 react: 19.1.0 - jotai@2.12.5(@types/react@19.1.9)(react@19.1.0): - optionalDependencies: - '@types/react': 19.1.9 - react: 19.1.0 - joycon@3.1.1: {} js-cookie@3.0.5: {} From c1d5576a2e896bc0e295fa02ebca4e9dc0eb1980 Mon Sep 17 00:00:00 2001 From: Nik Graf Date: Tue, 5 Aug 2025 20:42:36 +0200 Subject: [PATCH 2/3] add changeset --- .changeset/social-baths-send.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .changeset/social-baths-send.md diff --git a/.changeset/social-baths-send.md b/.changeset/social-baths-send.md new file mode 100644 index 00000000..331e2f82 --- /dev/null +++ b/.changeset/social-baths-send.md @@ -0,0 +1,10 @@ +--- +"@graphprotocol/hypergraph-react": minor +"@graphprotocol/hypergraph": minor +"@graphprotocol/typesync": minor +"@graphprotocol/hypergraph-cli": minor +"connect": minor +--- + +change dataType (text -> string, checkbox -> boolean) and update queries using value + \ No newline at end of file From bf5b5f469d0acc017b8e6b88675f833fe6a7b95e Mon Sep 17 00:00:00 2001 From: Nik Graf Date: Tue, 5 Aug 2025 21:37:48 +0200 Subject: [PATCH 3/3] fix test --- .../test/prepare-publish.test.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/hypergraph-react/test/prepare-publish.test.ts b/packages/hypergraph-react/test/prepare-publish.test.ts index 9977733d..ca23ef55 100644 --- a/packages/hypergraph-react/test/prepare-publish.test.ts +++ b/packages/hypergraph-react/test/prepare-publish.test.ts @@ -246,9 +246,9 @@ describe('preparePublish', () => { mockRequest.mockResolvedValue({ entity: { valuesList: [ - { propertyId: 'ed49ed7b-17b3-4df6-b0b5-11f78d82e151', value: 'Old Name' }, - { propertyId: 'a427183d-3519-4c96-b80a-5a0c64daed41', value: Graph.serializeNumber(25) }, - { propertyId: 'e4259554-42b1-46e4-84c3-f8681987770f', value: Graph.serializeBoolean(false) }, + { propertyId: 'ed49ed7b-17b3-4df6-b0b5-11f78d82e151', string: 'Old Name' }, + { propertyId: 'a427183d-3519-4c96-b80a-5a0c64daed41', number: 25 }, + { propertyId: 'e4259554-42b1-46e4-84c3-f8681987770f', boolean: false }, ], relationsList: [], }, @@ -284,18 +284,18 @@ describe('preparePublish', () => { mockRequest.mockResolvedValue({ entity: { valuesList: [ - { propertyId: 'ed49ed7b-17b3-4df6-b0b5-11f78d82e151', value: 'Same Name' }, - { propertyId: 'a427183d-3519-4c96-b80a-5a0c64daed41', value: Graph.serializeNumber(30) }, - { propertyId: 'e4259554-42b1-46e4-84c3-f8681987770f', value: Graph.serializeBoolean(true) }, - { propertyId: 'b5c0e2c7-9ac9-415e-8ffe-34f8b530f126', value: Graph.serializeDate(new Date('1993-01-01')) }, - { propertyId: '45e707a5-4364-42fb-bb0b-927a5a8bc061', value: Graph.serializePoint([0, 0]) }, + { propertyId: 'ed49ed7b-17b3-4df6-b0b5-11f78d82e151', string: 'Same Name' }, + { propertyId: 'a427183d-3519-4c96-b80a-5a0c64daed41', number: 30 }, + { propertyId: 'e4259554-42b1-46e4-84c3-f8681987770f', boolean: Graph.serializeBoolean(true) }, + { propertyId: 'b5c0e2c7-9ac9-415e-8ffe-34f8b530f126', time: Graph.serializeDate(new Date('1993-01-01')) }, + { propertyId: '45e707a5-4364-42fb-bb0b-927a5a8bc061', point: Graph.serializePoint([0, 0]) }, ], relationsList: [], }, }); const entity = { - id: '8f9a0b1c-2d3e-4f5a-6b7c-8d9e0f1a2b3c', + id: '778ee1c4-a4ac-424c-81b0-565147fca460', type: 'Person', name: 'Same Name', age: 30,