Skip to content

Conversation

@eddeee888
Copy link
Collaborator

Description

Previously, TypeScriptOperationVariablesToObject from typescript-operations was extending from typescript plugin. This made it (1) very hard to read, as we need to jump from base class <-> typescript class <-> typescript-operations class to understand the flow and (2) very hard to evolve the two independently (which is the point of this work).

Since there's not much shared logic anyways, it's simpler to extend the typescript-operations class from the base class directly.

Related #10496

Type of change

  • Breaking change

@changeset-bot
Copy link

changeset-bot bot commented Jan 15, 2026

🦋 Changeset detected

Latest commit: fccc3b2

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

This PR includes changesets to release 2 packages
Name Type
@graphql-codegen/typescript-operations Major
@graphql-codegen/client-preset 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

"dependencies": {
"@graphql-codegen/plugin-helpers": "^6.1.0",
"@graphql-codegen/schema-ast": "^5.0.0",
"@graphql-codegen/typescript": "^5.0.7",
Copy link
Collaborator Author

@eddeee888 eddeee888 Jan 15, 2026

Choose a reason for hiding this comment

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

Bye! 🫡

@graphql-codegen/typescript served us well for the last 10+ years. But with goal of creating the independence of typescript for typescript-operations plugin for this work, we can now remove this dep.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 15, 2026

🚀 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.1-alpha-20260115120206-c999e1213ed0c6f98d53a7a1821fe3de16f64c65 npm ↗︎ unpkg ↗︎
@graphql-codegen/introspection 5.0.1-alpha-20260115120206-c999e1213ed0c6f98d53a7a1821fe3de16f64c65 npm ↗︎ unpkg ↗︎
@graphql-codegen/visitor-plugin-common 7.0.0-alpha-20260115120206-c999e1213ed0c6f98d53a7a1821fe3de16f64c65 npm ↗︎ unpkg ↗︎
@graphql-codegen/typescript-document-nodes 5.0.8-alpha-20260115120206-c999e1213ed0c6f98d53a7a1821fe3de16f64c65 npm ↗︎ unpkg ↗︎
@graphql-codegen/gql-tag-operations 5.1.3-alpha-20260115120206-c999e1213ed0c6f98d53a7a1821fe3de16f64c65 npm ↗︎ unpkg ↗︎
@graphql-codegen/typescript-operations 6.0.0-alpha-20260115120206-c999e1213ed0c6f98d53a7a1821fe3de16f64c65 npm ↗︎ unpkg ↗︎
@graphql-codegen/typescript-resolvers 6.0.0-alpha-20260115120206-c999e1213ed0c6f98d53a7a1821fe3de16f64c65 npm ↗︎ unpkg ↗︎
@graphql-codegen/typed-document-node 6.1.6-alpha-20260115120206-c999e1213ed0c6f98d53a7a1821fe3de16f64c65 npm ↗︎ unpkg ↗︎
@graphql-codegen/typescript 6.0.0-alpha-20260115120206-c999e1213ed0c6f98d53a7a1821fe3de16f64c65 npm ↗︎ unpkg ↗︎
@graphql-codegen/client-preset 6.0.0-alpha-20260115120206-c999e1213ed0c6f98d53a7a1821fe3de16f64c65 npm ↗︎ unpkg ↗︎
@graphql-codegen/graphql-modules-preset 5.1.3-alpha-20260115120206-c999e1213ed0c6f98d53a7a1821fe3de16f64c65 npm ↗︎ unpkg ↗︎

Comment on lines -173 to -174
undefined,
undefined
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Since we are always passing undefined through, we can just use the default.

Comment on lines +22 to +31
_scalars: NormalizedScalarsMap,
_convertName: ConvertNameFn,
private _avoidOptionals: NormalizedAvoidOptionalsConfig,
private _immutableTypes: boolean,
_namespacedImportName: string | null,
_enumNames: string[],
_enumPrefix: boolean,
_enumSuffix: boolean,
_enumValues: ParsedEnumValuesMap,
_applyCoercion: boolean
Copy link
Collaborator Author

@eddeee888 eddeee888 Jan 15, 2026

Choose a reason for hiding this comment

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

There are lots of default values here from the typescript version of this class.

Since we are really dedicating this implementation for typescript-operations, it's a lot easier to force them to be non-optional since we only have one use case to cater for.

We event removed the last param _maybeType since we don't use it in typescript-operations any more!

_enumSuffix,
_enumValues,
_applyCoercion,
{}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is _directiveArgumentAndInputFieldMappings.

We were receiving undefined all the time from the only callsite, so it's ok to just pass through the default value.

@eddeee888 eddeee888 merged commit a09a5a7 into master-next Jan 15, 2026
@eddeee888 eddeee888 deleted the master-next-decouple-plugins branch January 15, 2026 12:09
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