Repository navigation
Conversation
Auto-generated by schema-propagation workflow. Source: constructive-db@ba31fc85160
|
Review complete. 🟡 3 medium 💬 Inline comments (3)
🧹 Nitpicks (4) — 🟢 4 low
This PR is a large (~750-file) codegen regeneration across
Reviewed commit: 2c4b749 |
There was a problem hiding this comment.
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
- 🟡
profilePictureVersionsselected as scalar inUserSelect— input-types.ts:732 - 🟡 Computed
*Url/*Versionsfields shipped as writable inputs — file.ts:363 - 🟡
sign-in-optionsCLI sends an empty selection set — sign-in-options.ts:21
| }; | ||
| select?: Record<string, boolean>; | ||
| }; | ||
| profilePictureVersions?: boolean; |
There was a problem hiding this comment.
🟡 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.
| 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, |
There was a problem hiding this comment.
🟡 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) ?? ''); |
There was a problem hiding this comment.
🟡 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.
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@ba31fc85160Schemas 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