fix(codegen): remove condition generation from ORM codegen#972
Merged
pyramation merged 1 commit intomainfrom Apr 10, 2026
Merged
fix(codegen): remove condition generation from ORM codegen#972pyramation merged 1 commit intomainfrom
pyramation merged 1 commit intomainfrom
Conversation
ConstructivePreset disables PgConditionArgumentPlugin, so *Condition input types do not exist in the schema. The ORM codegen was still emitting $condition variables in generated GraphQL queries, causing runtime errors like 'Variable $condition expected value of type DocumentCondition which cannot be used as an input type.' This commit removes condition generation entirely: - Remove TCondition type parameter from FindManyArgs/FindFirstArgs - Remove condition variable from buildFindManyDocument/buildFindFirstDocument - Remove conditionEnabled flags from ORM, CLI, and codegen generators - Remove generateTableConditionTypes and collectConditionExtraInputTypes - Remove condition from parseFindManyArgs/parseFindFirstArgs - Update all tests and snapshots
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ConstructivePresetdisablesPgConditionArgumentPluginandPgConditionCustomFieldsPlugin, so*Conditioninput types (e.g.DocumentCondition,DiligenceRequestCondition) do not exist in the GraphQL schema. However, the ORM codegen was still emitting$conditionvariables in generated GraphQL queries, causing runtime errors:This PR removes condition generation entirely from the codegen pipeline:
TConditiontype parameter andconditionproperty fromFindManyArgsandFindFirstArgs(both template and ORM copies inselect-types.ts)$conditionvariable emission frombuildFindManyDocumentandbuildFindFirstDocumentinquery-builder.tsparseFindManyArgsandparseFindFirstArgsincli-utils.tsconditionTypeNamestring literal from generated model classesconditionEnabledflags andconditionoption plumbing fromcli/index.ts,cli/table-command-generator.ts,codegen/index.ts,codegen/queries.ts, andgenerate.tsbuildTableConditionProperties,generateTableConditionTypes, andcollectConditionExtraInputTypesfunctionsReview & Testing Checklist for Human
condition: Any generated code or manually written code passingconditiontoFindManyArgs/FindFirstArgswill break at compile time. Check that SDK packages (constructive-sdk,constructive-react,constructive-node,constructive-cli) still build correctly after regeneration.orm-search.test.tsinpyramation-studio/diligence-roomagainst this branch to confirm the$conditionruntime error is resolved.utils.ts:getConditionTypeName()is still defined inutils.tsbut no longer imported anywhere — consider whether to remove it or keep it for potential future use.generateAllModelFilessignature: Third paramoptionswas effectively removed (alwaysundefinednow). Verify all callers inorm/index.tsand tests are compatible.Notes
conditionproperty onFindManyArgs/FindFirstArgs. This is intentional since the schema has no condition types.whereargument provided bygraphile-connection-filter.Link to Devin session: https://app.devin.ai/sessions/136ba9e7789e4cf28c757e6740c21808
Requested by: @pyramation