chore: update schemas, fix codegen bugs, add condition toggle (default: false)#799
Merged
pyramation merged 3 commits intomainfrom Mar 12, 2026
Merged
Conversation
…e bug, update vector comments
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:
|
Add a 'condition' config option (default: true) that controls whether condition types and condition arguments are generated on findMany/findFirst. When set to false: - Condition types are not generated in input-types - Condition params are omitted from model method signatures - FindManyArgs/FindFirstArgs use default 'never' for TCondition This allows users to turn off condition generation when using connection-filter's filter argument exclusively.
3 tasks
…on types
Changes the default value of codegen.condition from true to false.
Users can still opt in with codegen: { condition: true }.
Regenerated SDK and CLI output now omits condition types by default.
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.
chore: update schemas, fix codegen bugs, add condition toggle (default: false)
Summary
Four changes bundled together:
1. Schema update from constructive-db
Copied the 5
.graphqlschema files (admin, auth, public, app, objects — excluding private) fromconstructive-dbPR #567 (deps/mar-11) intosdk/constructive-sdk/schemas/, then regenerated bothconstructive-sdkandconstructive-clifrom them.2. Codegen duplicate identifier bug fix
generateCustomInputTypeswas re-emitting custom scalar types (e.g.ConstructiveInternalTypeEmail,ConstructiveInternalTypeOrigin) that had already been emitted bygenerateCustomScalarTypes, causingTS2300: Duplicate identifierbuild failures. Fixed by passing the set of already-generated custom scalar and enum type names intogenerateCustomInputTypesso it skips them.3. Optional condition generation toggle (new feature)
Added a
conditionconfig option (codegen.condition, defaults tofalse) that controls whether condition types and condition arguments are generated onfindMany/findFirstmethods. When set tofalse(the default):input-types-generator.ts(generateTableConditionTypesandcollectConditionExtraInputTypesare bypassed)conditionTypeNamefrom imports, type parameters, and runtime argumentsFindManyArgsandFindFirstArgsgain default type params (TCondition = never, TOrderBy = never) so they work with variable aritybuildFindManyDocument/buildFindFirstDocumentaccept optionalconditionTypeNameparameterUsers can opt in to condition generation by setting
codegen: { condition: true }.This is useful after migrating vector search from
conditiontofilterper PR #796 - the SDK no longer includes unused condition types by default.4. Regenerated SDK output (bulk of diff)
The regenerated SDK/CLI output now omits condition types by default (reflecting the new
condition: falsedefault). The diff shows -5,106 lines of condition-related types and plumbing removed:XxxConditioninterface declarations ininput-types.tsfindManysignature:FindManyArgs<S, Filter, OrderBy>(3 params, no condition)findFirstsignature:FindFirstArgs<S, Filter>(2 params, no condition)conditionproperty in method args objectsconditionTypeNameargument inbuildFindManyDocument/buildFindFirstDocumentcallsReview & Testing Checklist for Human
CRITICAL: Verify OrderBy type parameter positioning bug: When
condition: false, the model generator passes 3 type params toFindManyArgs<TSelect, TWhere, TCondition = never, TOrderBy = never>, which placesOrderByin theTConditionposition instead ofTOrderBy. This meansorderByfield is typed asnever[]instead of the actual order-by enum. Test by:condition: falsein codegen configfindMany({ orderBy: ['ID_ASC'] })in TypeScriptVerify
alreadyGeneratedTypesfix doesn't suppress needed types: The duplicate type fix pre-seedsgeneratedTypeswithcustomScalarTypes ∪ enumTypes. Spot-check a generatedinput-types.tsto ensure all expected input object types are present.Breaking change review - condition now defaults to false: Existing codebases upgrading will see condition types removed from generated code unless they explicitly set
codegen: { condition: true }. Verify:Verify template type param defaults work correctly: The
select-types.tstemplate usesTCondition = never, TOrderBy = neverdefaults. Verify:FindManyArgs<S, Where, Condition, OrderBy>works correctlyFindManyArgs<S, Where, OrderBy>- check if OrderBy ends up in correct position or TCondition positionTest Plan
pnpm testin the codegen package — ✅ All 310 tests passpnpm buildat repo root — ✅ Full build succeeds with no TypeScript errors (but doesn't catch semantic issues with type param positions)condition: false, then write code that usesfindMany({ orderBy: [...] })and verify it compiles and runs correctlycondition: true, verify condition types work as beforeUpdates Since Last Revision
condition: truetocondition: false: The feature now defaults to omitting condition types. Users who want condition types must opt in withcodegen: { condition: true }.@defaultcomment now correctly statesfalseinstead oftrue.Notes
FindManyArgswhen condition is disabled needs verification - there may be a bug whereorderBybecomes unusableLink to Devin Session: https://app.devin.ai/sessions/c7c114e9d17e421bba9564e48d0421c0
Requested by: @pyramation