Skip to content

Conversation

@eddeee888
Copy link
Collaborator

Description

This PR updates avoidOptionals config option in typescript-operations to only support object, inputValue and defaultValue.

Strictly speaking, this is a type change because the rest of the options did not have any effect on the plugin. However, since it's an interface change, it's a breaking change and it's mentioned so in the changeset

I've also did a couple of drove-by fixes:

  • for docs
  • for Changeset setup to ignore dev-test-apollo-tooling

Related #10496

Type of change

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

@changeset-bot
Copy link

changeset-bot bot commented Jan 21, 2026

🦋 Changeset detected

Latest commit: cddb06a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@graphql-codegen/typescript-operations Major
@graphql-codegen/client-preset Major
@graphql-codegen/cli Patch

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

"ignore": [
"website",
"example-*",
"dev-test*",
Copy link
Collaborator Author

@eddeee888 eddeee888 Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

Similar to example folders, the modules in dev-test (which includes the example for Apollo tooling migration), should be ignored, otherwise it'd show up in Changeset interface

@github-actions
Copy link
Contributor

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
@graphql-codegen/cli 6.1.2-alpha-20260121105018-cddb06acaff1e8871880dbab01eea71c1639578b npm ↗︎ unpkg ↗︎
@graphql-codegen/introspection 5.0.1-alpha-20260121105018-cddb06acaff1e8871880dbab01eea71c1639578b npm ↗︎ unpkg ↗︎
@graphql-codegen/visitor-plugin-common 7.0.0-alpha-20260121105018-cddb06acaff1e8871880dbab01eea71c1639578b npm ↗︎ unpkg ↗︎
@graphql-codegen/typescript-document-nodes 5.0.8-alpha-20260121105018-cddb06acaff1e8871880dbab01eea71c1639578b npm ↗︎ unpkg ↗︎
@graphql-codegen/gql-tag-operations 5.1.3-alpha-20260121105018-cddb06acaff1e8871880dbab01eea71c1639578b npm ↗︎ unpkg ↗︎
@graphql-codegen/typescript-operations 6.0.0-alpha-20260121105018-cddb06acaff1e8871880dbab01eea71c1639578b npm ↗︎ unpkg ↗︎
@graphql-codegen/typescript-resolvers 6.0.0-alpha-20260121105018-cddb06acaff1e8871880dbab01eea71c1639578b npm ↗︎ unpkg ↗︎
@graphql-codegen/typed-document-node 6.1.6-alpha-20260121105018-cddb06acaff1e8871880dbab01eea71c1639578b npm ↗︎ unpkg ↗︎
@graphql-codegen/typescript 6.0.0-alpha-20260121105018-cddb06acaff1e8871880dbab01eea71c1639578b npm ↗︎ unpkg ↗︎
@graphql-codegen/client-preset 6.0.0-alpha-20260121105018-cddb06acaff1e8871880dbab01eea71c1639578b npm ↗︎ unpkg ↗︎
@graphql-codegen/graphql-modules-preset 5.1.3-alpha-20260121105018-cddb06acaff1e8871880dbab01eea71c1639578b npm ↗︎ unpkg ↗︎

Comment on lines -11 to -12
*
* Note: In most configurations, this plugin requires you to use `typescript as well, because it depends on its base types.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing this makes me feel we are so close now!

Comment on lines -178 to -180
// FIXME: this is the legacy avoidOptionals which was used to make Result fields non-optional. This use case is no longer valid.
// It's also being used for Variables so people could already be using it.
// Maybe it's better to deprecate and remove, to see what users think.
Copy link
Collaborator Author

@eddeee888 eddeee888 Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep it for now to keep the scope of this project manageable

@eddeee888 eddeee888 changed the title [typescript-operations] Cut down avoidOptionals to only support object, inputValue and defaultValue [typescript-operations] Cut down avoidOptionals to only support object, inputValue and defaultValue (+ minor drive-by fixes) Jan 21, 2026
@eddeee888 eddeee888 merged commit 51ac09e into master-next Jan 21, 2026
28 of 35 checks passed
@eddeee888 eddeee888 deleted the master-next-review-avoid-optionals branch January 21, 2026 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants