Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
9a05596
Add dummy commit to create branch
eddeee888 Nov 7, 2025
eb313f7
Ensure CI runs
eddeee888 Nov 15, 2025
b58311d
[typescript-operations] Generate `Exact` into target file (#10504)
eddeee888 Nov 15, 2025
8f87b69
[typescript-operations] Remove inputmaybe and scalars (#10509)
ikusakov2 Nov 24, 2025
9dde187
chore(dependencies): updated changesets for modified dependencies
github-actions[bot] Nov 24, 2025
e293132
[typescript-operations] Extract convertSchemaEnumToDeclarationBlockSt…
eddeee888 Nov 25, 2025
d636a7d
[typescript-operations] Generate enums referenced in operation Variab…
eddeee888 Nov 25, 2025
863eced
[typescript-operations] Add missing enum tests & fix enum generating …
eddeee888 Dec 3, 2025
1b386f6
Add generatesOperationTypes config option to generate shared types on…
eddeee888 Dec 4, 2025
9c90bb6
[typescript-operations] Add importSchemaTypesFrom to import user-defi…
eddeee888 Dec 8, 2025
2658276
[typescript-operations][client-preset] Integrate new typescript-opera…
eddeee888 Dec 13, 2025
98bd16f
[typescript-operations] No optional Result fields, unless deferred or…
eddeee888 Dec 17, 2025
9bcf329
Generate input types and output enums into target file (#10527)
ikusakov2 Dec 24, 2025
b7045b3
Remove placeholder and test release 🤞
eddeee888 Dec 24, 2025
e17d768
Test snapshot release
eddeee888 Dec 24, 2025
8fd4558
[typescript-operations] Fix __typename optionality and nullability (#…
eddeee888 Dec 30, 2025
fdaf5d6
[typescript-operations] Clean up selection set processor that depends…
eddeee888 Jan 1, 2026
c2be6b3
Adjust config inheritance to reflect usage and type-hint better (#10560)
eddeee888 Jan 6, 2026
6af5ec9
chore(dependencies): updated changesets for modified dependencies
github-actions[bot] Jan 6, 2026
414f6b0
Fix issues after rebasing (#10563)
eddeee888 Jan 7, 2026
d731066
chore(dependencies): updated changesets for modified dependencies
github-actions[bot] Jan 7, 2026
cda43e2
Remove unused utility types and functions (#10564)
eddeee888 Jan 7, 2026
e1d4180
Add config extract all fields to types field names only (same as apol…
ikusakov2 Jan 11, 2026
9a71231
Only generate `Exact` utility type if documents have operations (#10571)
eddeee888 Jan 13, 2026
e8959d9
Make `unknown` instead of `any` the default scalar type (#10566)
eddeee888 Jan 15, 2026
a09a5a7
Decouple `typescript-operations` plugin from `typescript` plugin (#10…
eddeee888 Jan 15, 2026
56accfa
chore(dependencies): updated changesets for modified dependencies
github-actions[bot] Jan 15, 2026
b55828d
Add `inputMaybeValue` to allow changing Variables and Input nullable …
eddeee888 Jan 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@graphql-codegen/typescript-operations": patch
---
dependencies updates:
- Added dependency [`@graphql-codegen/schema-ast@^5.0.0` ↗︎](https://www.npmjs.com/package/@graphql-codegen/schema-ast/v/5.0.0) (to `dependencies`)
- Removed dependency [`@graphql-codegen/typescript@^5.0.7` ↗︎](https://www.npmjs.com/package/@graphql-codegen/typescript/v/5.0.7) (from `dependencies`)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@graphql-codegen/typescript-operations": patch
---
dependencies updates:
- Added dependency [`@graphql-codegen/schema-ast@^5.0.0` ↗︎](https://www.npmjs.com/package/@graphql-codegen/schema-ast/v/5.0.0) (to `dependencies`)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@graphql-codegen/typescript-operations": patch
---
dependencies updates:
- Removed dependency [`@graphql-codegen/typescript@^5.0.7` ↗︎](https://www.npmjs.com/package/@graphql-codegen/typescript/v/5.0.7) (from `dependencies`)
11 changes: 11 additions & 0 deletions .changeset/breezy-games-enter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
'@graphql-codegen/visitor-plugin-common': major
'@graphql-codegen/typescript-operations': major
'@graphql-codegen/client-preset': major
---

Fix nullable field optionality in operations

Previously, a nullable Result field is generated as optional (marked by `?` TypeScript modifier) by default. This is not correct, because generally at runtime such field can only be `null`, and not `undefined` (both missing from the object OR `undefined`). The only exceptions are when fields are deferred (using `@defer` directive) or marked as conditional (using `@skip` or `@include`).

Now, a nullable Result field cannot be optional unless the exceptions are met. This also limits `avoidOptionals` to only target Variables input, since some users may want to force explicit `null` when providing operation variables.
27 changes: 27 additions & 0 deletions .changeset/brown-things-jump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
'@graphql-codegen/visitor-plugin-common': major
'@graphql-codegen/typescript-operations': major
'@graphql-codegen/typescript': major
'@graphql-codegen/typescript-resolvers': major
---

BREAKING CHANGE: visitors' config option are moved based on their use case

- addTypename/skipTypename: is only a types-visitor concern. This is moved to types-visitor from base-visitor
- nonOptionalTypename: is a documents-visitor and types-visitor concern. Moved from base-visitor there
- extractAllFieldsToTypes: is a documents-visitor concern. Moved from base-visitor there
- enumPrefix and enumSuffix: need to be in base-visitor as all 3 types of visitors need this to correctly sync the enum type names. This is moved to base visitor
- ignoreEnumValuesFromSchema: is a documents-visitor and types-visitor concern. Moved from base-visitor there.
- globalNamespace: is a documents-visitor concern. Moved from base-visitor there

Refactors

- documents-visitor no longer extends types-visitor _option types_ as they have two distinct usages now. The types now extend base-visitor types. This is now consistent with documents-visitor extending base-visitor
- Classes now handle config parsing and types at the same level e.g. if typescript-operations plugin parses configOne, then the types for configOne must be in that class, rather than in base-documents-visitor

Note: These visitors are rolled up into one type for simplicity

- base-visitor: includes `base-visitor`
- documents-visitor: includes `base-documents-visitor` and `typescript-operations` visitor
- types-visitor: includes `base-types-visitor` and `typescript` visitor
- resolvers-visitor: includes `base-resolvers-visitor` and `typescript-resolvers` visitor
6 changes: 6 additions & 0 deletions .changeset/clever-loops-crash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@graphql-codegen/visitor-plugin-common': minor
'@graphql-codegen/typescript-operations': minor
---

Add importSchemaTypesFrom support
5 changes: 5 additions & 0 deletions .changeset/curly-trees-lead.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-codegen/typescript-operations': major
---

BREAKING CHANGE: typescript-operations plugin now generates enum if it is used in operation.
6 changes: 6 additions & 0 deletions .changeset/every-queens-sin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@graphql-codegen/typescript-operations': major
'@graphql-codegen/client-preset': major
---

Conditionally generate input types and output enums into target file
9 changes: 9 additions & 0 deletions .changeset/every-rooms-camp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@graphql-codegen/visitor-plugin-common': major
'@graphql-codegen/typescript-operations': major
'@graphql-codegen/typescript': major
'@graphql-codegen/typescript-resolvers': major
'@graphql-codegen/client-preset': major
---

BREAKING CHANGE: make `unknown` instead of `any` the default custom scalar type
5 changes: 5 additions & 0 deletions .changeset/five-cases-sniff.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-codegen/visitor-plugin-common': minor
---

Adding config option extractAllFieldsToTypesCompact, which renders nested types names with field names only (without types)
5 changes: 5 additions & 0 deletions .changeset/fuzzy-poets-doubt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-codegen/typescript-operations': patch
---

Re-implement inputMaybeValue
9 changes: 9 additions & 0 deletions .changeset/khaki-clubs-say.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@graphql-codegen/typescript-operations': patch
---

Only generate `Exact` utility type at the top if it is used

`Exact` utility is only used to wrap variables types for operations (queries, mutations and subscriptions) if they exist in the document. `Exact` is never used when there are _only_ fragments.

This is important to conditionally generate as users may use very strict tsconfig that will fail compiling if there are unused types.
9 changes: 9 additions & 0 deletions .changeset/khaki-spies-admire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@graphql-codegen/typescript-operations': major
---

BREAKING CHANGE: Decouple `typescript-operations` plugin from `typescript` plugin

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.
6 changes: 6 additions & 0 deletions .changeset/khaki-turtles-juggle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@graphql-codegen/typescript-operations': major
'@graphql-codegen/typescript': minor
---

The `typescript-operations` plugin no longer generates InputMaybe and Scalars types; it now uses native Typescript types instead.
7 changes: 7 additions & 0 deletions .changeset/lovely-sloths-kiss.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@graphql-codegen/typescript-operations': major
'@graphql-codegen/typescript': major
'@graphql-codegen/client-preset': major
---

BREAKING CHANGE: `typescript` plugin no longer generates `Exact` utility type. Instead, `typescript-operations` generates said utility type for every file it creates. This is because it is used _only_ for `Variables`, so we only need to generate it once for every generated operation file.
5 changes: 5 additions & 0 deletions .changeset/proud-cougars-hear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-codegen/visitor-plugin-common': major
---

BREAKING CHANGE: `@graphql-codegen/visitor-plugin-common`'s `base-types-visitor` no longer has `getNodeComment` or `buildEnumValuesBlock` method.
6 changes: 6 additions & 0 deletions .changeset/proud-jobs-decide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@graphql-codegen/visitor-plugin-common': minor
'@graphql-codegen/typescript-operations': minor
---

Add generatesOperationTypes to typescript-operations to allow omitting operation types such as Variables, Query/Mutation/Subscription selection set, and Fragment types
14 changes: 14 additions & 0 deletions .changeset/real-numbers-fall.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
'@graphql-codegen/visitor-plugin-common': major
'@graphql-codegen/typescript-operations': major
'@graphql-codegen/client-preset': major
---

BREAKING CHANGE: Operation plugin and Client Preset no longer generates optional `__typename` for result type

`__typenam` should not be in the request unless:

- explicitly requested by the user
- automatically injected into the request by clients, such as Apollo Clients.

Note: Apollo Client users can still use `nonOptionalTypename: true` and `skipTypeNameForRoot: true` to ensure generated types match the runtime behaviour.
6 changes: 6 additions & 0 deletions .changeset/salty-guests-retire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@graphql-codegen/typescript-operations': major
'@graphql-codegen/client-preset': major
---

Integrate new typescript-operations into client-preset
5 changes: 5 additions & 0 deletions .changeset/silly-kiwis-sip.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-codegen/typescript': patch
---

Extract utilities from base-type-visitor to be shared with other plugins later: convertSchemaEnumToDeclarationBlockString, getNodeComment
9 changes: 9 additions & 0 deletions .changeset/tidy-jobs-unite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@graphql-codegen/visitor-plugin-common': patch
'@graphql-codegen/typescript-operations': patch
'@graphql-codegen/typescript': patch
'@graphql-codegen/typescript-resolvers': patch
'@graphql-codegen/client-preset': patch
---

Abstract how enum imports are generated into visitor-plugin-common package
13 changes: 13 additions & 0 deletions .changeset/twelve-trams-pump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
'@graphql-codegen/visitor-plugin-common': major
'@graphql-codegen/typescript': major
---

BREAKING CHANGE: Remove unused utility types from `typescript` plugin as they were previously used for `typescript-operations` plugin:

- `MakeOptional`
- `MakeMaybe`
- `MakeEmpty`
- `Incremental`

BREAKING CHANGE: Remove `getRootTypeNames` function because it's available in `@graphql-utils/tools` and not used anywhere
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ on:
push:
branches:
- master
- master-next # FIXME:eddeee888 Remove once done
pull_request:
branches:
- master
- master-next # FIXME:eddeee888 Remove once released

env:
NODE_OPTIONS: '--max_old_space_size=4096'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
pull_request:
branches:
- master
- master-next # FIXME:eddeee888 Remove once done

permissions:
contents: write
Expand Down
Loading