Skip to content

chore: update schemas from constructive-db - #1994

Open
Anmol1696 wants to merge 1 commit into
mainfrom
schema-update/20261112-041558
Open

Anmol1696 wants to merge 1 commit into
mainfrom
schema-update/20261112-041558

Conversation

@Anmol1696

Copy link
Copy Markdown
Contributor

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@a3181bb37da

Schemas updated

  • sdk/constructive-sdk/schemas/ — all API targets from constructive-db (auto-discovered)
  • sdk/migrate-client/schemas/ — migrate
  • pgpm/export/src/meta-export-tables.json — generated meta export table list

Clients regenerated

  • sdk/constructive-sdk/src/ — ORM client
  • sdk/constructive-cli/src/ — CLI client
  • sdk/constructive-react/src/ — React hooks
  • sdk/migrate-client/src/ — Migrate client

Skill references updated

  • .agents/skills/ — Generated skill documentation

Auto-generated by constructive-hub schema-propagation

Auto-generated by schema-propagation workflow.
Source: constructive-db@a3181bb37da
@luxor-code-review

luxor-code-review Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Review complete. 🟡 1 medium

Approval withheld: the whole pull request could not be checked.

💬 Inline comments (1)

🧹 Nitpicks (5) — 🟢 5 low
  • 🟢 Usage help still lists removed create subcommand (ast-migration.ts:33) — This PR removes the create subcommand (menu option, case 'create', and handleCreate) from table CLI commands whose backing mutations were dropped from the schema, but the per-command usage help string was not regenerated and still advertises create Create a new ... (sdk/constructive-cli/src/api/cli/commands/ast-migration.ts:33).
  • 🟢 Delete stale skill docs for removed operations (builder-binding.md:1) — This PR deletes the builderBinding/platformBuilderBinding models and the resolve-site-app-links/api-schema-names commands from the generated SDK, and it updates the SKILL.md indexes and adds replacement service-binding/platform-service-binding docs — but the old reference files remain on disk and still teach agents the removed operations (.agents/skills/cli-compute/references/builder-binding.md:1).
  • 🟢 Dropped create() leaves orphan imports in principal models (principal.ts:12) — The removed create() method in sdk/constructive-sdk/src/auth/orm/models/principal.ts:12 leaves buildCreateDocument and CreateArgs imported but unused; the same orphans appear in principalEntity.ts.
  • 🟢 CLI prints exchangeNativeHandoff response including access token (exchange-native-handoff.ts:45) — The new csdk exchange-native-handoff command prints the entire mutation response via console.log(JSON.stringify(result, null, 2)) (sdk/constructive-cli/src/auth/cli/commands/exchange-native-handoff.ts:45).
  • 🟢 Wire serviceHostname into api/platform-api CLI handlers (api.ts:27) — serviceHostname was added to the fieldSchema of the regenerated api/platform-api commands but never wired in: it appears in no prompt array, no create/update data object, and no default select (sdk/constructive-cli/src/api/cli/commands/api.ts:27).

This is a machine-regenerated SDK refresh driven by updated GraphQL schema snapshots, changing 691 files across sdk/constructive-sdk, sdk/constructive-react, sdk/constructive-cli, and the .agents/skills reference docs. The generation is internally consistent: removed schema items, ORM models, CLI commands, React hooks, and barrels all stay in step, and repo-wide greps found no dangling references in shipped code.

Files Change
sdk/constructive-sdk/schemas/*.graphql Updated schema snapshots: BuilderBinding→ServiceBinding rename, new auth mutations (ensureAuthCsrf, exchangeNativeHandoff, requestDeviceApproval, createPrincipal), dropped create mutations for secrets/records/files, added PlatformReservedSubdomain and createFunctionGraph
sdk/constructive-{sdk,react,cli}/src/**/orm Regenerated ORM models, input types, and query/mutation barrels matching the new schemas, including new serviceBinding.ts/platformServiceBinding.ts models
sdk/constructive-react/src/**/hooks Regenerated React Query hooks, query keys, mutation keys, and invalidation maps for the renamed and added operations
sdk/constructive-cli/src/**/cli/commands Regenerated CLI commands: renames applied (sign-in-options, current-database-id, service-binding), new auth/platform commands registered in command maps and usage strings
.agents/skills/** Regenerated skill reference docs for the new, renamed, and removed CLI operations

Reviewers should verify the upstream servers actually stopped exposing the removed mutations, since the schema snapshots are inputs to this generation.

Reviewed commit: eebd3be

@luxor-code-review luxor-code-review Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment on lines 43 to 54
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,
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant