[typescript-operations] Add importSchemaTypesFrom to import user-defined+used input/enum types externally#10534
Merged
eddeee888 merged 13 commits intomaster-nextfrom Dec 8, 2025
Merged
Conversation
🦋 Changeset detectedLatest commit: 55bd13e The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
eddeee888
commented
Dec 7, 2025
eddeee888
commented
Dec 7, 2025
| const extraType = this.config.allowUndefinedQueryVariables && operationType === 'Query' ? ' | undefined' : ''; | ||
|
|
||
| return `${prefix}Exact<${variablesBlock === '{}' ? `{ [key: string]: never; }` : variablesBlock}>${extraType}`; | ||
| return `Exact<${variablesBlock === '{}' ? `{ [key: string]: never; }` : variablesBlock}>${extraType}`; |
Collaborator
Author
There was a problem hiding this comment.
Exact is always local now, so we don't need to import it from the external file
10 tasks
eddeee888
commented
Dec 8, 2025
Comment on lines
-243
to
-251
| /** The episodes in the Star Wars trilogy */ | ||
| export type Episode = | ||
| /** Star Wars Episode V: The Empire Strikes Back, released in 1980. */ | ||
| | 'EMPIRE' | ||
| /** Star Wars Episode VI: Return of the Jedi, released in 1983. */ | ||
| | 'JEDI' | ||
| /** Star Wars Episode IV: A New Hope, released in 1977. */ | ||
| | 'NEWHOPE'; | ||
|
|
Collaborator
Author
There was a problem hiding this comment.
This was added in https://github.com/dotansimha/graphql-code-generator/pull/10508/files#diff-93fb10b6a6c50ed7c1b33ca57cfbb1209c0d1d314d2edfdd3d2f04039dc8996dR243-R251 accidentally. This shouldn't be added unless it's used
eddeee888
added a commit
that referenced
this pull request
Jan 6, 2026
…ned+used input/enum types externally (#10534) * Draft importSchemaTypesFrom * Minor test fixes * Fix test name * Update dev-tests * Baseline dev-test for importSchemaTypesFrom * Implement relative import paths correctly * Update tests to handle outputDir correctly * Add test for absolute importSchemaTypesFrom * Remove unncessary files * Add test about unused things * Remove comment * Add comments * Add changeset
eddeee888
added a commit
that referenced
this pull request
Jan 20, 2026
…ned+used input/enum types externally (#10534) * Draft importSchemaTypesFrom * Minor test fixes * Fix test name * Update dev-tests * Baseline dev-test for importSchemaTypesFrom * Implement relative import paths correctly * Update tests to handle outputDir correctly * Add test for absolute importSchemaTypesFrom * Remove unncessary files * Add test about unused things * Remove comment * Add comments * Add changeset
eddeee888
added a commit
that referenced
this pull request
Feb 25, 2026
…ned+used input/enum types externally (#10534) * Draft importSchemaTypesFrom * Minor test fixes * Fix test name * Update dev-tests * Baseline dev-test for importSchemaTypesFrom * Implement relative import paths correctly * Update tests to handle outputDir correctly * Add test for absolute importSchemaTypesFrom * Remove unncessary files * Add test about unused things * Remove comment * Add comments * Add changeset
eddeee888
added a commit
that referenced
this pull request
Mar 3, 2026
…ned+used input/enum types externally (#10534) * Draft importSchemaTypesFrom * Minor test fixes * Fix test name * Update dev-tests * Baseline dev-test for importSchemaTypesFrom * Implement relative import paths correctly * Update tests to handle outputDir correctly * Add test for absolute importSchemaTypesFrom * Remove unncessary files * Add test about unused things * Remove comment * Add comments * Add changeset
ikusakov2
pushed a commit
to ikusakov2/graphql-code-generator
that referenced
this pull request
Mar 4, 2026
…ned+used input/enum types externally (dotansimha#10534) * Draft importSchemaTypesFrom * Minor test fixes * Fix test name * Update dev-tests * Baseline dev-test for importSchemaTypesFrom * Implement relative import paths correctly * Update tests to handle outputDir correctly * Add test for absolute importSchemaTypesFrom * Remove unncessary files * Add test about unused things * Remove comment * Add comments * Add changeset
eddeee888
added a commit
that referenced
this pull request
Mar 8, 2026
…ned+used input/enum types externally (#10534) * Draft importSchemaTypesFrom * Minor test fixes * Fix test name * Update dev-tests * Baseline dev-test for importSchemaTypesFrom * Implement relative import paths correctly * Update tests to handle outputDir correctly * Add test for absolute importSchemaTypesFrom * Remove unncessary files * Add test about unused things * Remove comment * Add comments * Add changeset
eddeee888
added a commit
that referenced
this pull request
Mar 8, 2026
…ned+used input/enum types externally (#10534) * Draft importSchemaTypesFrom * Minor test fixes * Fix test name * Update dev-tests * Baseline dev-test for importSchemaTypesFrom * Implement relative import paths correctly * Update tests to handle outputDir correctly * Add test for absolute importSchemaTypesFrom * Remove unncessary files * Add test about unused things * Remove comment * Add comments * Add changeset
eddeee888
added a commit
that referenced
this pull request
Mar 8, 2026
…ned+used input/enum types externally (#10534) * Draft importSchemaTypesFrom * Minor test fixes * Fix test name * Update dev-tests * Baseline dev-test for importSchemaTypesFrom * Implement relative import paths correctly * Update tests to handle outputDir correctly * Add test for absolute importSchemaTypesFrom * Remove unncessary files * Add test about unused things * Remove comment * Add comments * Add changeset
eddeee888
added a commit
that referenced
this pull request
Mar 12, 2026
…ned+used input/enum types externally (#10534) * Draft importSchemaTypesFrom * Minor test fixes * Fix test name * Update dev-tests * Baseline dev-test for importSchemaTypesFrom * Implement relative import paths correctly * Update tests to handle outputDir correctly * Add test for absolute importSchemaTypesFrom * Remove unncessary files * Add test about unused things * Remove comment * Add comments * Add changeset
eddeee888
added a commit
that referenced
this pull request
Mar 19, 2026
…ned+used input/enum types externally (#10534) * Draft importSchemaTypesFrom * Minor test fixes * Fix test name * Update dev-tests * Baseline dev-test for importSchemaTypesFrom * Implement relative import paths correctly * Update tests to handle outputDir correctly * Add test for absolute importSchemaTypesFrom * Remove unncessary files * Add test about unused things * Remove comment * Add comments * Add changeset
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.
Description
We want
typescript-operationsto natively support importing types from another file. Previously, this is done by import-types preset, but it's a community plugin so keeping things in-sync is a bit tedious.Part of feature branch: #10496
Related #10479
Notes:
output enumandnested inputcan be done once Generate input types and output enums into target file #10527 is mergedType of change
How Has This Been Tested?