Repository navigation
Conversation
Auto-generated by schema-propagation workflow. Source: constructive-db@020ea4d9956
|
Review complete. 🟡 1 medium 💬 Inline comments (1)
🧹 Nitpicks (5) — 🟢 5 low
This PR is a codegen regeneration across four SDK packages, so nearly every change mirrors a schema edit. The schemas are the source of truth for what changed: additions (
The regeneration itself is internally consistent; the findings below concern generated output that is stale or behaviorally surprising for downstream consumers, not hand-written code. Reviewed commit: 2e6e4c3 |
There was a problem hiding this comment.
Regenerates the SDK artifacts (sdk/* CLI/ORM/React hooks and sdk/*/schemas/*.graphql) plus the .agents/skills reference docs from updated GraphQL schemas, adding ServiceBinding, PlatformReservedSubdomain, and auth mutations (createPrincipal, ensureAuthCsrf, exchangeNativeHandoff, requestDeviceApproval) while removing BuilderBinding, upload mutations/scalar, record-style create mutations, and dbname/enableDirectUploads fields.
Key findings
- 🟡 Regenerated create mutations lost cache invalidation — useCreatePrincipalMutation.ts:43
| return useMutation({ | ||
| mutationKey: principalMutationKeys.create(), | ||
| mutationFn: (data: CreatePrincipalInput['principal']) => | ||
| mutationKey: customMutationKeys.createPrincipal(), | ||
| mutationFn: (variables: CreatePrincipalVariables) => | ||
| getClient() | ||
| .principal.create({ | ||
| data, | ||
| .mutation.createPrincipal(variables, { | ||
| select: args.select, | ||
| }) | ||
| } as { | ||
| select: S; | ||
| } & StrictSelect<S, CreatePrincipalPayloadSelect>) | ||
| .unwrap(), | ||
| onSuccess: () => { | ||
| queryClient.invalidateQueries({ | ||
| queryKey: principalKeys.lists(), | ||
| }); | ||
| }, | ||
| ...mutationOptions, | ||
| }); |
There was a problem hiding this comment.
🟡 bug · medium
Regenerated create mutations lost cache invalidation
The regenerated useCreatePrincipalMutation dropped the onSuccess cache invalidation that the previous table-based version performed (queryClient.invalidateQueries({ queryKey: principalKeys.lists() })); the new hook only wires mutationKey and mutationFn (sdk/constructive-react/src/auth/hooks/mutations/useCreatePrincipalMutation.ts:43). Principal list queries served by the still-exported principal query hooks now serve stale data after a successful create until their next refetch window. The same regression applies to useCreateFunctionGraphMutation, which previously invalidated functionGraphKeys.lists() (sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphMutation.ts:46).
📋 Prompt for AI Agents
In the @constructive-io/graphql-codegen template that emits custom-mutation hooks, restore the dropped onSuccess cache invalidation: after a successful createPrincipal, call queryClient.invalidateQueries({ queryKey: principalKeys.lists() }) (regenerates sdk/constructive-react/src/auth/hooks/mutations/useCreatePrincipalMutation.ts lines 43-54), and after createFunctionGraph invalidate functionGraphKeys.lists() (sdk/constructive-react/src/compute/hooks/mutations/useCreateFunctionGraphMutation.ts lines 46-58). Import useQueryClient from @tanstack/react-query and the corresponding key factories from ../query-keys, and keep ...mutationOptions spread last so caller options can override the built-in handler. Then regenerate the affected packages.
|
Superseded by #2016 (merged), regenerated from current constructive-db main with codegen 5.25.33. |
Automated Schema + SDK Update
This PR was created by the schema-propagation workflow.
What changed
Updated schema files from constructive-db and regenerated ALL SDK clients.
Source:
constructive-db@020ea4d9956Schemas updated
sdk/constructive-sdk/schemas/— all API targets from constructive-db (auto-discovered)sdk/migrate-client/schemas/— migratepgpm/export/src/meta-export-tables.json— generated meta export table listClients regenerated
sdk/constructive-sdk/src/— ORM clientsdk/constructive-cli/src/— CLI clientsdk/constructive-react/src/— React hookssdk/migrate-client/src/— Migrate clientSkill references updated
.agents/skills/— Generated skill documentationAuto-generated by constructive-hub schema-propagation