-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Re-implement inputMaybeValue to allow changing Variables and Input nullable types
#10573
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
Re-implement inputMaybeValue to allow changing Variables and Input nullable types
#10573
Conversation
🦋 Changeset detectedLatest commit: adb5b53 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 |
🚀 Snapshot Release (
|
| Package | Version | Info |
|---|---|---|
@graphql-codegen/cli |
6.1.1-alpha-20260115134814-adb5b53d959481d6b58ec13970e929f7c509bd63 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/introspection |
5.0.1-alpha-20260115134814-adb5b53d959481d6b58ec13970e929f7c509bd63 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/visitor-plugin-common |
7.0.0-alpha-20260115134814-adb5b53d959481d6b58ec13970e929f7c509bd63 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/typescript-document-nodes |
5.0.8-alpha-20260115134814-adb5b53d959481d6b58ec13970e929f7c509bd63 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/gql-tag-operations |
5.1.3-alpha-20260115134814-adb5b53d959481d6b58ec13970e929f7c509bd63 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/typescript-operations |
6.0.0-alpha-20260115134814-adb5b53d959481d6b58ec13970e929f7c509bd63 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/typescript-resolvers |
6.0.0-alpha-20260115134814-adb5b53d959481d6b58ec13970e929f7c509bd63 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/typed-document-node |
6.1.6-alpha-20260115134814-adb5b53d959481d6b58ec13970e929f7c509bd63 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/typescript |
6.0.0-alpha-20260115134814-adb5b53d959481d6b58ec13970e929f7c509bd63 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/client-preset |
6.0.0-alpha-20260115134814-adb5b53d959481d6b58ec13970e929f7c509bd63 |
npm ↗︎ unpkg ↗︎ |
@graphql-codegen/graphql-modules-preset |
5.1.3-alpha-20260115134814-adb5b53d959481d6b58ec13970e929f7c509bd63 |
npm ↗︎ unpkg ↗︎ |
| * ``` | ||
| */ | ||
| maybeValue?: string; | ||
| inputMaybeValue?: string; |
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.
I was debating whether we need to support inputMaybeValue as it can be misused and cause runtime errors for users.
However, I've decided to keep it:
- Since
typescript-operationsis a low-level plugin, we could allow flexibilities for advanced users - It's previously supported
- It's still not supported by client-preset, which is the main thing users should reach for, so the chance of foot-gunning is lower.
inputMaybeValue to allow changing Variables and Input nullable typesinputMaybeValue to allow changing Variables and Input nullable types
Description
This PR re-implements
inputMaybeValuefortypescript-operationsuse case.This was implemented for both Input and Variables previously, but temporarily removed from
typescript-operationsplugin whilst we refactor and decouple the plugins.Main change: Instead of using
InputMaybewrapper, we now inline it:InputMaybe<string>string | null | undefined(iftype InputMaybe = T | null | undefined)Related #10496
Note: This may create a foot-gun situation since users could misuse the option. However,
typescript-operationsis a low-level plugin, and this is not supported byclient-preset, so this is ok to keep IMO.Type of change