Only generate Exact utility type if documents have operations#10571
Merged
eddeee888 merged 6 commits intomaster-nextfrom Jan 13, 2026
Merged
Only generate Exact utility type if documents have operations#10571eddeee888 merged 6 commits intomaster-nextfrom
Exact utility type if documents have operations#10571eddeee888 merged 6 commits intomaster-nextfrom
Conversation
🦋 Changeset detectedLatest commit: 42d82df The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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
Jan 13, 2026
Comment on lines
+102
to
+117
| mutation MakeAdmin { | ||
| makeUserAdmin(id: "100") { | ||
| ...UserFragment | ||
| } | ||
| } | ||
|
|
||
| subscription UserChanges { | ||
| makeUserAdmin(id: "100") { | ||
| ...UserFragment | ||
| } | ||
| } | ||
|
|
||
| fragment UserFragment on User { | ||
| id | ||
| role | ||
| } |
Collaborator
Author
There was a problem hiding this comment.
Adding these to make sure we test many things in the default test.
This gives more confidence overall.
e.g. in this PR I want to make sure Exact is used for mutation and subscription variables.
eddeee888
commented
Jan 13, 2026
Comment on lines
-715
to
-724
| type ResponseError { | ||
| error: ResponseErrorType! | ||
| } | ||
|
|
||
| enum ResponseErrorType { | ||
| NOT_FOUND | ||
| INPUT_VALIDATION_ERROR | ||
| FORBIDDEN_ERROR | ||
| UNEXPECTED_ERROR | ||
| } |
Collaborator
Author
There was a problem hiding this comment.
Extraneous and never used in this test, so removed.
Contributor
🚀 Snapshot Release (
|
| Package | Version | Info |
|---|---|---|
@graphql-codegen/cli |
6.1.1-alpha-20260113134512-42d82dfa5bd5d9a89b285c06f6591dca2a782062 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/introspection |
5.0.1-alpha-20260113134512-42d82dfa5bd5d9a89b285c06f6591dca2a782062 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/visitor-plugin-common |
7.0.0-alpha-20260113134512-42d82dfa5bd5d9a89b285c06f6591dca2a782062 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/typescript-document-nodes |
5.0.8-alpha-20260113134512-42d82dfa5bd5d9a89b285c06f6591dca2a782062 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/gql-tag-operations |
5.1.3-alpha-20260113134512-42d82dfa5bd5d9a89b285c06f6591dca2a782062 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/typescript-operations |
6.0.0-alpha-20260113134512-42d82dfa5bd5d9a89b285c06f6591dca2a782062 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/typescript-resolvers |
6.0.0-alpha-20260113134512-42d82dfa5bd5d9a89b285c06f6591dca2a782062 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/typed-document-node |
6.1.6-alpha-20260113134512-42d82dfa5bd5d9a89b285c06f6591dca2a782062 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/typescript |
6.0.0-alpha-20260113134512-42d82dfa5bd5d9a89b285c06f6591dca2a782062 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/client-preset |
6.0.0-alpha-20260113134512-42d82dfa5bd5d9a89b285c06f6591dca2a782062 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/graphql-modules-preset |
5.1.3-alpha-20260113134512-42d82dfa5bd5d9a89b285c06f6591dca2a782062 |
npm ↗︎ unpkg ↗︎ |
10 tasks
1 task
eddeee888
added a commit
that referenced
this pull request
Jan 20, 2026
* Remove extraneous test setup * Do not generate Exact utility type of not used * Add default test case to check that Exact is used for Mutation and Subscription variables * Update dev-tests * Add changeset * Remove extraneous config for Exact test
eddeee888
added a commit
that referenced
this pull request
Feb 25, 2026
* Remove extraneous test setup * Do not generate Exact utility type of not used * Add default test case to check that Exact is used for Mutation and Subscription variables * Update dev-tests * Add changeset * Remove extraneous config for Exact test
eddeee888
added a commit
that referenced
this pull request
Mar 3, 2026
* Remove extraneous test setup * Do not generate Exact utility type of not used * Add default test case to check that Exact is used for Mutation and Subscription variables * Update dev-tests * Add changeset * Remove extraneous config for Exact test
ikusakov2
pushed a commit
to ikusakov2/graphql-code-generator
that referenced
this pull request
Mar 4, 2026
…nsimha#10571) * Remove extraneous test setup * Do not generate Exact utility type of not used * Add default test case to check that Exact is used for Mutation and Subscription variables * Update dev-tests * Add changeset * Remove extraneous config for Exact test
eddeee888
added a commit
that referenced
this pull request
Mar 8, 2026
* Remove extraneous test setup * Do not generate Exact utility type of not used * Add default test case to check that Exact is used for Mutation and Subscription variables * Update dev-tests * Add changeset * Remove extraneous config for Exact test
eddeee888
added a commit
that referenced
this pull request
Mar 8, 2026
* Remove extraneous test setup * Do not generate Exact utility type of not used * Add default test case to check that Exact is used for Mutation and Subscription variables * Update dev-tests * Add changeset * Remove extraneous config for Exact test
eddeee888
added a commit
that referenced
this pull request
Mar 8, 2026
* Remove extraneous test setup * Do not generate Exact utility type of not used * Add default test case to check that Exact is used for Mutation and Subscription variables * Update dev-tests * Add changeset * Remove extraneous config for Exact test
eddeee888
added a commit
that referenced
this pull request
Mar 12, 2026
* Remove extraneous test setup * Do not generate Exact utility type of not used * Add default test case to check that Exact is used for Mutation and Subscription variables * Update dev-tests * Add changeset * Remove extraneous config for Exact test
eddeee888
added a commit
that referenced
this pull request
Mar 19, 2026
* Remove extraneous test setup * Do not generate Exact utility type of not used * Add default test case to check that Exact is used for Mutation and Subscription variables * Update dev-tests * Add changeset * Remove extraneous config for Exact test
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
Exactutility is only used to wrap variables types for operations (queries, mutations and subscriptions) if they exist in the document.Exactis never used for when there are fragments.This is important to conditionally generate as users may use very strict tsconfig that will fail compiling if there are unused types.
This PR ensures
Exactis conditionally generated: only generated when there are operations.Related #10496
Type of change
How Has This Been Tested?