Skip to content

chore: update schemas from constructive-db (post-file-urls-release) - #2011

Closed
Anmol1696 wants to merge 1 commit into
mainfrom
schema-update/post-file-urls-release
Closed

Anmol1696 wants to merge 1 commit into
mainfrom
schema-update/post-file-urls-release

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

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@ba31fc85160
@luxor-code-review

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

Copy link
Copy Markdown

Review complete. 🟡 3 medium

💬 Inline comments (3)

🧹 Nitpicks (4) — 🟢 4 low
  • 🟢 Stale usage strings advertise removed create subcommand (secret.ts:28) — The regeneration removed the create subcommand from the dispatch tables and autocomplete options of the regenerated CLI commands, but their usage help strings still list "create Create a new ..." (secret.ts:28, function-graph.ts:32).
  • 🟢 README example sends scalar for array entityIds (README.md:807) — The createPrincipal mutation input was reshaped to a flat input with entityIds?: string[] (sdk/constructive-cli/src/auth/orm/input-types.ts:2037), but the regenerated README example shows entityIds: '<UUID>' as a single scalar value (sdk/constructive-cli/src/auth/orm/README.md:807).
  • 🟢 Stale skill docs for removed schema operations (resolve-route.md:1) — The regeneration removed resolveRoute, resolveDeepLink, resolveSiteAppLinks, and apiSchemaNames from sdk/constructive-sdk/schemas/api.graphql and deleted their CLI commands and React hooks, but the generated skill reference docs still document the removed commands: .agents/skills/cli-api/references/resolve-route.md, resolve-deep-link.md, resolve-site-app-links.md, and api-schema-names.md.
  • 🟢 README keeps Required create fields after create removal (README.md:423) — In the regenerated admin CLI README, the my-pending-app-invites-record (and sibling record) tables had their create row removed from the subcommand table, yet the **Required create fields:** line was kept (sdk/constructive-cli/src/admin/cli/README.md:423), documenting required create inputs for a subcommand that no longer exists.

This PR is a large (~750-file) codegen regeneration across constructive-sdk, constructive-cli, constructive-react, and migrate-client, driven by schema updates: removal of table-level create mutations for read-only/computed tables, removal of dropped fields (dbname, enableDirectUploads, upload fields), renaming BuilderBinding to ServiceBinding, removal of resolveRoute/resolveDeepLink/resolveSiteAppLinks/apiSchemaNames, addition of PlatformReservedSubdomain, new auth ops (createPrincipal, ensureAuthCsrf, exchangeNativeHandoff, requestDeviceApproval, signInOptions), and new computed file-URL/version fields. The generated artifacts are largely internally consistent across packages, but the generator templates left several inconsistencies behind.

Files Change
sdk/constructive-sdk/schemas/*.graphql Schema snapshots updated: ops/fields removed and added as above.
sdk/constructive-cli/src/** CLI commands, ORM models, and input types regenerated; record-style commands lost their create subcommand; new ops and PlatformReservedSubdomain/ServiceBinding wired into routers and model indexes.
sdk/constructive-react/src/** React Query hooks, query/mutation keys, and schema types regenerated in step with the CLI/SDK packages.
sdk/migrate-client/** Regenerated against the extended migrate.graphql (metadata fields, MetaFileField).
.agents/skills/** Generated skill references refreshed, but stale docs for removed ops/entities were left behind.

Reviewed commit: 2c4b749

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

Regenerated SDK/CLI/React artifacts from updated GraphQL schemas, with a few generator-template inconsistencies (invalid scalar selects for object-typed fields, stale create-subcommand strings/docs, and stale skill references).

Key findings

};
select?: Record<string, boolean>;
};
profilePictureVersions?: boolean;

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

profilePictureVersions selected as scalar in UserSelect

UserSelect.profilePictureVersions is typed as a plain boolean (profilePictureVersions?: boolean, sdk/constructive-cli/src/auth/orm/input-types.ts:732), but the schema declares User.profilePictureVersions: [FileVersion!] where FileVersion is an object type (sdk/constructive-sdk/schemas/auth.graphql:2347). Selecting it via the ORM emits profilePictureVersions with no subselection set, which GraphQL validation rejects on every execution. Any user query including profilePictureVersions: true fails at runtime; the same generated defect appears in the constructive-sdk/constructive-react auth packages and the admin packages.

📋 Prompt for AI Agents

In sdk/constructive-cli/src/auth/orm/input-types.ts (and the identical generated copies in sdk/constructive-sdk/src/auth/orm/input-types.ts, sdk/constructive-react/src/auth/orm/input-types.ts, and the admin packages), change the UserSelect entry profilePictureVersions?: boolean; to an object-shaped select with a nested select over the FileVersion fields (format, height, key, name, size, url, width), because the schema field User.profilePictureVersions: [FileVersion!] is an object type (sdk/constructive-sdk/schemas/auth.graphql:7038, type FileVersion at 2347) and requires a subselection. Prefer fixing in the codegen so regeneration stays consistent.

Comment on lines +363 to +377
downloadUrl: cleanedData.downloadUrl,
expiryEnqueuedAt: cleanedData.expiryEnqueuedAt,
filePath: cleanedData.filePath,
filename: cleanedData.filename,
isPublic: cleanedData.isPublic,
key: cleanedData.key,
mimeType: cleanedData.mimeType,
promotedAt: cleanedData.promotedAt,
rejectionReason: cleanedData.rejectionReason,
size: cleanedData.size,
status: cleanedData.status,
tags: cleanedData.tags,
upload: cleanedData.upload,
uploadUrl: cleanedData.uploadUrl,
uploadVersions: cleanedData.uploadVersions,

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

Computed *Url/*Versions fields shipped as writable inputs

The regenerated CLI update handler forwards downloadUrl, filePath, uploadUrl, and uploadVersions into the mutation's data object (file.ts:363-377), but FilePatch in sdk/constructive-cli/src/storage/orm/input-types.ts:986 does not declare any of these fields — they are server-computed, read-only columns. Running file update --downloadUrl x (or any of the other three) sends an input field the server does not accept, and the mutation is rejected with a validation error. The same defect exists in platform-file.ts against PlatformFilePatch.

The same generator defect treats other computed file-reference fields as writable: the CLI fieldSchema maps profilePictureUrl/profilePictureVersions as plain strings (sdk/constructive-cli/src/auth/cli/commands/user.ts:24), and the generated create examples in the auth and api ORM READMEs include profilePictureUrl, profilePictureVersions, and attachmentsUrl/attachmentsVersions — fields absent from the corresponding UserInput/ProposalCommentInput types.

📋 Prompt for AI Agents

In the @constructive-io/graphql-codegen CLI generator, filter fields whose GraphQL output type is computed or carries arguments (e.g. uploadUrl(width: Int), downloadUrl, filePath, uploadVersions, profilePictureUrl, profilePictureVersions, attachmentsUrl, attachmentsVersions) out of the writable fieldSchema, the update data payloads in sdk/constructive-cli/src/storage/cli/commands/file.ts (lines 258-377) and platform-file.ts, and the create/update examples in the generated READMEs (sdk/constructive-cli/src/auth/orm/README.md, sdk/constructive-cli/src/api/orm/README.md and their sdk/react equivalents), since FilePatch/PlatformFilePatch/UserInput/ProposalCommentInput do not declare them and the server rejects unknown input fields. Regenerate the SDK.

const client = getClient();
const selectFields = buildSelectFromPaths((argv.select as string) ?? '');

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

sign-in-options CLI sends an empty selection set

The new CLI command defaults argv.select to an empty string and passes the result as the query selection (sdk/constructive-cli/src/auth/cli/commands/sign-in-options.ts:21), but buildSelectFromPaths('') returns {} (utils.ts:277-314) and the signInOptions ORM operation requires a subfield selection on its record return type. With no --select given, the request fails GraphQL validation (Field 'signInOptions' must have a selection of subfields), making the newly shipped command unusable out of the box.

📋 Prompt for AI Agents

In sdk/constructive-cli/src/auth/cli/commands/sign-in-options.ts around line 21, change buildSelectFromPaths((argv.select as string) ?? '') to fall back to a valid field of the SignInOptionsRecord (e.g. 'allowSignUp') so the generated query always carries a non-empty selection set. Prefer fixing the codegen template that emits query-record CLI commands.

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Superseded by #2016 (merged), regenerated from current constructive-db main with codegen 5.25.33.

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