fix: generate TypeScript types for custom scalar filter types (EmailFilter, ImageFilter, UploadFilter)#882
Merged
pyramation merged 1 commit intomainfrom Mar 21, 2026
Conversation
…lFilter etc.) from all filter fields, not just plugin-injected ones
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
Fixes
TS2552: Cannot find name 'ConstructiveInternalTypeEmailFilter'(andImageFilter,UploadFilter) build errors in SDK codegen output.Root cause:
collectFilterExtraInputTypes()skipped fields matching table column names, assuming only plugin-injected fields could reference non-standard filter types. But regular columns with custom scalar types (e.g.,ConstructiveInternalTypeEmail) also have custom filter types in the schema (ConstructiveInternalTypeEmailFilter) that need TypeScript definitions generated.Fix: Remove the
tableFieldNamesskip. Instead, check ALL filter fields (exceptand/or/not) and collect any referenced type that isn't a known GraphQL scalar or an already-generated base filter type (BASE_FILTER_TYPE_NAMES).Review & Testing Checklist for Human
tableFieldNamesguard means relation-derived filter fields (e.g.,memberByContactId: MemberFilter) will also be collected. These should be de-duplicated downstream bytableCrudTypesingenerateCustomInputTypes, but verify no duplicateexport type/interfacedeclarations appear in generated output.BASE_FILTER_TYPE_NAMEScovers allSCALAR_FILTER_CONFIGSnames: The new guard relies onBASE_FILTER_TYPE_NAMES(fromscalars.ts) to skip already-generated scalar filter types. If any name inSCALAR_FILTER_CONFIGSis missing fromBASE_FILTER_TYPE_NAMES, it would be collected and potentially duplicated.constructive-db(admin/migrate/public schemas) to confirmConstructiveInternalTypeEmailFilter,ConstructiveInternalTypeImageFilter, andConstructiveInternalTypeUploadFilterare now generated and the build succeeds.Notes
collectConditionExtraInputTypes()function (for condition types) still has thetableFieldNamesguard. Condition fields for standard columns use raw scalar types (not custom filter types), so the same bug doesn't apply there. However, if custom scalar condition types emerge in the future, the same fix may be needed.Link to Devin session: https://app.devin.ai/sessions/745d2d10b699452091e24131ba5edef2
Requested by: @pyramation