-
Notifications
You must be signed in to change notification settings - Fork 10
Nik/upgrade to the new grc-20 and new testnet #583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request upgrades the @graphprotocol/grc-20 package from version ^0.27.0 to ^0.32.2 and adapts the codebase to work with the new testnet staging environment. The upgrade introduces breaking changes to the GRC-20 API, requiring comprehensive updates to type names, field names, and data handling patterns throughout the codebase.
Changes:
- Upgraded
@graphprotocol/grc-20dependency from^0.27.0to^0.32.2across all packages and apps - Migrated API endpoints from
testnet-api.geobrowser.iototestnet-api-staging.geobrowser.io - Adapted codebase to new GRC-20 v2 data model with typed property values instead of string serialization
Reviewed changes
Copilot reviewed 37 out of 38 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Updated package resolution for @graphprotocol/grc-20@0.32.2, replaced @bufbuild/protobuf with @geoprotocol/grc-20 dependency, updated rolldown bindings |
| package.json (root) | Updated @graphprotocol/grc-20 to ^0.32.2 |
| packages/hypergraph/package.json | Updated @graphprotocol/grc-20 to ^0.32.2 |
| packages/hypergraph-react/package.json | Updated @graphprotocol/grc-20 to ^0.32.2 |
| packages/typesync-studio/package.json | Updated @graphprotocol/grc-20 to ^0.32.2 |
| apps/events/package.json | Updated @graphprotocol/grc-20 to ^0.32.2 |
| apps/connect/package.json | Updated @graphprotocol/grc-20 to ^0.32.2 |
| apps/next-example/package.json | Updated @graphprotocol/grc-20 to ^0.32.2 |
| apps/privy-login-example/package.json | Updated @graphprotocol/grc-20 to ^0.32.2 |
| packages/hypergraph/src/mapping/Mapping.ts | Changed type Op to GrcOp, updated data type mappings (NUMBER → FLOAT64, STRING → TEXT) |
| packages/hypergraph/src/utils/translate-filter-to-graphql.ts | Removed Graph import, updated field names (string → text, number → float), removed number serialization |
| packages/hypergraph/src/utils/convert-property-value.ts | Updated property interface with new field names (string → text, number → float) |
| packages/hypergraph/src/utils/relation-query-helpers.ts | Updated GraphQL query fragments with new field names |
| packages/hypergraph/src/utils/convert-relations.ts | Updated ValueList type definition with new field names |
| packages/hypergraph/src/entity/find-many-public.ts | Updated GraphQL queries and type definitions with new field names |
| packages/hypergraph/src/entity/find-one-public.ts | Updated GraphQL queries with new field names |
| packages/hypergraph/src/entity/search-many-public.ts | Updated GraphQL queries with new field names |
| packages/hypergraph/src/space/find-many-public.ts | Updated GraphQL queries and field access patterns |
| packages/hypergraph-react/src/prepare-publish.ts | Migrated from string serialization to typed property values using PropertyValueParam, removed all Graph.serialize* calls |
| packages/hypergraph-react/src/publish-ops.ts | Changed type Op to GrcOp |
| packages/hypergraph-react/src/internal/use-delete-entity-public.tsx | Added local unsetEntityValues implementation with type assertion workaround, changed type Op to GrcOp |
| packages/hypergraph-react/src/internal/generate-delete-ops.tsx | Changed type Op to GrcOp |
| packages/hypergraph/test/mapping/Mapping.test.ts | Updated test expectations for new data type names |
| packages/hypergraph/test/utils/translate-filter-to-graphql.test.ts | Removed Graph import, updated all test expectations with new field names |
| packages/hypergraph/test/entity/find-one-public.test.ts | Updated test data structures with new field names |
| packages/hypergraph/test/entity/find-many-public.test.ts | Updated test data structures with new field names |
| packages/hypergraph/test/space/find-many-public.test.ts | Updated test data structures with new field names |
| packages/hypergraph-react/test/prepare-publish.test.ts | Removed Graph import, updated mock data with new field names and removed serialization calls |
| apps/events/src/Boot.tsx | Updated API origin to staging environment |
| apps/events/test-script.ts | Updated API origin to staging environment |
| apps/events/src/components/create-properties-and-types-todos.tsx | Changed type Op to GrcOp, updated data type names |
| apps/events/src/components/create-properties-and-types-event.tsx | Changed type Op to GrcOp, updated data type names |
| apps/events/src/components/create-events.tsx | Changed type Op to GrcOp, added typed property value structures |
| apps/events/src/routes/podcasts.lazy.tsx | Reordered import statements |
| apps/privy-login-example/src/components/create-properties-and-types-todos.tsx | Changed type Op to GrcOp, updated data type names |
| apps/privy-login-example/src/components/create-properties-and-types-event.tsx | Changed type Op to GrcOp, updated data type names |
| apps/privy-login-example/src/components/create-events.tsx | Changed type Op to GrcOp, added typed property value structures |
| .claude/settings.local.json | Added additional development tool permissions |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Local implementation since unsetEntityValues is not exported from Graph namespace | ||
| // Note: The UNSET_ENTITY_VALUES op type exists in the v2 binary format but isn't | ||
| // included in the GrcOp type definition. Using type assertion as a workaround. | ||
| const unsetEntityValues = ({ id, properties }: { id: string; properties: string[] }) => { | ||
| const op = { | ||
| type: 'UNSET_ENTITY_VALUES', | ||
| unsetEntityValues: { | ||
| id: Id(id), | ||
| properties: properties.map((propertyId) => Id(propertyId)), | ||
| }, | ||
| } as unknown as GrcOp; | ||
| return { id: Id(id), ops: [op] }; |
Copilot
AI
Jan 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The local implementation of unsetEntityValues uses a type assertion as unknown as GrcOp to work around the fact that UNSET_ENTITY_VALUES operation type is not included in the GrcOp type definition from the @graphprotocol/grc-20 package. While this is a temporary workaround as noted in the comment, this creates a type safety gap. If the actual operation structure in the library differs from what's implemented here, it could cause runtime errors that TypeScript won't catch. Consider opening an issue with the @graphprotocol/grc-20 maintainers to properly export this operation type, or verify that the structure matches the binary format specification exactly.
| // Local implementation since unsetEntityValues is not exported from Graph namespace | |
| // Note: The UNSET_ENTITY_VALUES op type exists in the v2 binary format but isn't | |
| // included in the GrcOp type definition. Using type assertion as a workaround. | |
| const unsetEntityValues = ({ id, properties }: { id: string; properties: string[] }) => { | |
| const op = { | |
| type: 'UNSET_ENTITY_VALUES', | |
| unsetEntityValues: { | |
| id: Id(id), | |
| properties: properties.map((propertyId) => Id(propertyId)), | |
| }, | |
| } as unknown as GrcOp; | |
| return { id: Id(id), ops: [op] }; | |
| type UnsetEntityValuesOp = { | |
| type: 'UNSET_ENTITY_VALUES'; | |
| unsetEntityValues: { | |
| id: ReturnType<typeof Id>; | |
| properties: Array<ReturnType<typeof Id>>; | |
| }; | |
| }; | |
| const isUnsetEntityValuesOp = (op: unknown): op is GrcOp => { | |
| if ( | |
| typeof op !== 'object' || | |
| op === null || | |
| (op as any).type !== 'UNSET_ENTITY_VALUES' | |
| ) { | |
| return false; | |
| } | |
| const unset = (op as any).unsetEntityValues; | |
| if (typeof unset !== 'object' || unset === null) { | |
| return false; | |
| } | |
| if (!('id' in unset)) { | |
| return false; | |
| } | |
| if (!Array.isArray(unset.properties)) { | |
| return false; | |
| } | |
| return true; | |
| }; | |
| // Local implementation since unsetEntityValues is not exported from Graph namespace | |
| // Note: The UNSET_ENTITY_VALUES op type exists in the v2 binary format but isn't | |
| // included in the GrcOp type definition. | |
| const unsetEntityValues = ({ id, properties }: { id: string; properties: string[] }) => { | |
| const opCandidate: UnsetEntityValuesOp = { | |
| type: 'UNSET_ENTITY_VALUES', | |
| unsetEntityValues: { | |
| id: Id(id), | |
| properties: properties.map((propertyId) => Id(propertyId)), | |
| }, | |
| }; | |
| if (!isUnsetEntityValuesOp(opCandidate)) { | |
| throw new Error('Invalid UNSET_ENTITY_VALUES operation structure'); | |
| } | |
| return { id: Id(id), ops: [opCandidate] }; |
| import { useEntities, useEntity, usePublicSpaces } from '@graphprotocol/hypergraph-react'; | ||
| import { createLazyFileRoute } from '@tanstack/react-router'; | ||
| import { Person, PersonHostTest, Podcast, Topic } from '@/schema'; |
Copilot
AI
Jan 21, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The import statements have been reordered. While this doesn't affect functionality, the imports from @/schema should typically come after external package imports (from @graphprotocol and @tanstack). Consider maintaining consistent import ordering throughout the codebase for better maintainability.
No description provided.