Repository navigation
Conversation
Auto-generated by schema-propagation workflow. Source: constructive-db@a3181bb37da
|
Review complete. 🟡 1 medium Approval withheld: the whole pull request could not be checked. 💬 Inline comments (1)
🧹 Nitpicks (5) — 🟢 5 low
This is a machine-regenerated SDK refresh driven by updated GraphQL schema snapshots, changing 691 files across
Reviewers should verify the upstream servers actually stopped exposing the removed mutations, since the schema snapshots are inputs to this generation. Reviewed commit: eebd3be |
There was a problem hiding this comment.
Regenerates all three SDK client packages (constructive-sdk, constructive-react, constructive-cli) plus their skill docs after schema updates, introducing new auth mutations, a ServiceBinding rename, and removal of create mutations for restricted models.
Key findings
- 🟡 Regenerated
useCreatePrincipalMutationdrops list 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 useCreatePrincipalMutation drops list invalidation
The previous hand-written hook invalidated principalKeys.lists() after a successful create; the regenerated generated hook at sdk/constructive-react/src/auth/hooks/mutations/useCreatePrincipalMutation.ts:43 no longer invalidates any queries on success. After creating a principal, React Query caches for principal lists stay stale until remount or manual refetch.
The hook's variables/result shape also changed from CreatePrincipalInput['principal'] / { createPrincipal: { principal } } to CreatePrincipalVariables / { createPrincipal: CreatePrincipalPayload | null }, so consumers compiled against the old shape break at compile time regardless.
📋 Prompt for AI Agents
In sdk/constructive-react/src/auth/hooks/mutations/useCreatePrincipalMutation.ts, restore the query-cache invalidation the previous version had: import useQueryClient and principalKeys, obtain const queryClient = useQueryClient(), and add onSuccess: () => { queryClient.invalidateQueries({ queryKey: principalKeys.lists() }); } to the useMutation options before spreading ...mutationOptions (merge with any user-supplied onSuccess). Then fix the corresponding @constructive-io/graphql-codegen custom-mutation template so generated hooks keep emitting this invalidation; the shape change from CreatePrincipalInput['principal'] to CreatePrincipalVariables should also get a migration note since the old signature was published.
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@a3181bb37daSchemas 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