Make unknown instead of any the default scalar type#10566
Merged
eddeee888 merged 6 commits intomaster-nextfrom Jan 15, 2026
Merged
Make unknown instead of any the default scalar type#10566eddeee888 merged 6 commits intomaster-nextfrom
unknown instead of any the default scalar type#10566eddeee888 merged 6 commits intomaster-nextfrom
Conversation
🦋 Changeset detectedLatest commit: b87e885 The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 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 |
Contributor
🚀 Snapshot Release (
|
| Package | Version | Info |
|---|---|---|
@graphql-codegen/cli |
6.1.1-alpha-20260113141826-b87e885fd6c88d2baffa14fd9f42f0f1b5a4dfcb |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/introspection |
5.0.1-alpha-20260113141826-b87e885fd6c88d2baffa14fd9f42f0f1b5a4dfcb |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/visitor-plugin-common |
7.0.0-alpha-20260113141826-b87e885fd6c88d2baffa14fd9f42f0f1b5a4dfcb |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/typescript-document-nodes |
5.0.8-alpha-20260113141826-b87e885fd6c88d2baffa14fd9f42f0f1b5a4dfcb |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/gql-tag-operations |
5.1.3-alpha-20260113141826-b87e885fd6c88d2baffa14fd9f42f0f1b5a4dfcb |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/typescript-operations |
6.0.0-alpha-20260113141826-b87e885fd6c88d2baffa14fd9f42f0f1b5a4dfcb |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/typescript-resolvers |
6.0.0-alpha-20260113141826-b87e885fd6c88d2baffa14fd9f42f0f1b5a4dfcb |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/typed-document-node |
6.1.6-alpha-20260113141826-b87e885fd6c88d2baffa14fd9f42f0f1b5a4dfcb |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/typescript |
6.0.0-alpha-20260113141826-b87e885fd6c88d2baffa14fd9f42f0f1b5a4dfcb |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/client-preset |
6.0.0-alpha-20260113141826-b87e885fd6c88d2baffa14fd9f42f0f1b5a4dfcb |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/graphql-modules-preset |
5.1.3-alpha-20260113141826-b87e885fd6c88d2baffa14fd9f42f0f1b5a4dfcb |
npm ↗︎ unpkg ↗︎ |
1f47eb4 to
ffb3b8f
Compare
eddeee888
commented
Jan 8, 2026
| } | ||
|
|
||
| typePart = usedInputType.tsType; // If the schema is correct, when reversing typeNodes, the first node would be `NamedType`, which means we can safely set it as the base for typePart | ||
| if (usedInputType.tsType !== 'any' && !typeNode.isNonNullable) { |
Collaborator
Author
There was a problem hiding this comment.
When unknown and any is used, | null | undefined is not required.
However, the logic could be complex, so I'll bring back this condition and tests in another PR.
10 tasks
eddeee888
commented
Jan 12, 2026
packages/plugins/typescript/operations/src/ts-operation-variables-to-object.ts
Outdated
Show resolved
Hide resolved
70dd961 to
033594f
Compare
eddeee888
added a commit
that referenced
this pull request
Jan 20, 2026
* Make default scalar unknown, instead of any * Set up defaultScalarType tests * Add changeset * Revert unrelated null | undefined changes * Fix test description * Add a test case for custom scalar in dev-test
eddeee888
added a commit
that referenced
this pull request
Feb 25, 2026
* Make default scalar unknown, instead of any * Set up defaultScalarType tests * Add changeset * Revert unrelated null | undefined changes * Fix test description * Add a test case for custom scalar in dev-test
eddeee888
added a commit
that referenced
this pull request
Mar 3, 2026
* Make default scalar unknown, instead of any * Set up defaultScalarType tests * Add changeset * Revert unrelated null | undefined changes * Fix test description * Add a test case for custom scalar in dev-test
ikusakov2
pushed a commit
to ikusakov2/graphql-code-generator
that referenced
this pull request
Mar 4, 2026
…0566) * Make default scalar unknown, instead of any * Set up defaultScalarType tests * Add changeset * Revert unrelated null | undefined changes * Fix test description * Add a test case for custom scalar in dev-test
eddeee888
added a commit
that referenced
this pull request
Mar 8, 2026
* Make default scalar unknown, instead of any * Set up defaultScalarType tests * Add changeset * Revert unrelated null | undefined changes * Fix test description * Add a test case for custom scalar in dev-test
eddeee888
added a commit
that referenced
this pull request
Mar 8, 2026
* Make default scalar unknown, instead of any * Set up defaultScalarType tests * Add changeset * Revert unrelated null | undefined changes * Fix test description * Add a test case for custom scalar in dev-test
eddeee888
added a commit
that referenced
this pull request
Mar 8, 2026
* Make default scalar unknown, instead of any * Set up defaultScalarType tests * Add changeset * Revert unrelated null | undefined changes * Fix test description * Add a test case for custom scalar in dev-test
eddeee888
added a commit
that referenced
this pull request
Mar 12, 2026
* Make default scalar unknown, instead of any * Set up defaultScalarType tests * Add changeset * Revert unrelated null | undefined changes * Fix test description * Add a test case for custom scalar in dev-test
eddeee888
added a commit
that referenced
this pull request
Mar 19, 2026
* Make default scalar unknown, instead of any * Set up defaultScalarType tests * Add changeset * Revert unrelated null | undefined changes * Fix test description * Add a test case for custom scalar in dev-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
anydisables any typechecks and feedback from the TypeScript language server.unknownforces the user to check at runtime, so it's better thanany.This PR:
unknownfor the reasons above.undefinedvalues if it is nullableRelated #10496
Type of change