-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Make unknown instead of any the default scalar type
#10566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master-next
Are you sure you want to change the base?
Conversation
|
🚀 Snapshot Release (
|
| Package | Version | Info |
|---|---|---|
@graphql-codegen/cli |
6.1.1-alpha-20260108144012-ffb3b8f6699be60beacb03a4eeed3051b758e606 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/introspection |
5.0.1-alpha-20260108144012-ffb3b8f6699be60beacb03a4eeed3051b758e606 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/visitor-plugin-common |
7.0.0-alpha-20260108144012-ffb3b8f6699be60beacb03a4eeed3051b758e606 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/typescript-document-nodes |
5.0.8-alpha-20260108144012-ffb3b8f6699be60beacb03a4eeed3051b758e606 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/gql-tag-operations |
5.1.3-alpha-20260108144012-ffb3b8f6699be60beacb03a4eeed3051b758e606 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/typescript-operations |
6.0.0-alpha-20260108144012-ffb3b8f6699be60beacb03a4eeed3051b758e606 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/typescript-resolvers |
6.0.0-alpha-20260108144012-ffb3b8f6699be60beacb03a4eeed3051b758e606 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/typed-document-node |
6.1.6-alpha-20260108144012-ffb3b8f6699be60beacb03a4eeed3051b758e606 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/typescript |
6.0.0-alpha-20260108144012-ffb3b8f6699be60beacb03a4eeed3051b758e606 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/client-preset |
6.0.0-alpha-20260108144012-ffb3b8f6699be60beacb03a4eeed3051b758e606 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/graphql-modules-preset |
5.1.3-alpha-20260108144012-ffb3b8f6699be60beacb03a4eeed3051b758e606 |
npm ↗︎ unpkg ↗︎ |
3c7cf8c to
1f47eb4
Compare
1f47eb4 to
ffb3b8f
Compare
| } | ||
|
|
||
| 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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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