Skip to content

Update client codegen doc to match v6 release#13162

Merged
jerelmiller merged 7 commits into
apollographql:mainfrom
eddeee888:update-codegen-doc
Apr 30, 2026
Merged

Update client codegen doc to match v6 release#13162
jerelmiller merged 7 commits into
apollographql:mainfrom
eddeee888:update-codegen-doc

Conversation

@eddeee888
Copy link
Copy Markdown
Contributor

@eddeee888 eddeee888 commented Feb 28, 2026

This PR updates GraphQL Codegen docs for typescript-operations and client-preset v6 release: dotansimha/graphql-code-generator#10496

Summary by CodeRabbit

  • Documentation
    • Updated GraphQL Code Generator guidance to favor operation-only generated types and simplified starter examples.
    • Removed several advanced customization options and deprecated inline base-type settings in favor of importing a central generated types artifact.
    • Clarified client-preset and near-operation-file guidance and added a config option to avoid duplicate operation-type generation for consistency.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 28, 2026

⚠️ No Changeset found

Latest commit: 19c2ae7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@apollo-librarian
Copy link
Copy Markdown
Contributor

apollo-librarian Bot commented Feb 28, 2026

⚠️ AI Style Review — 14 Issues Found

Summary

The pull request includes updates to improve clarity, directness, and adherence to style guide standards across several sections: framing and voice were enhanced by adopting an authoritative, imperative tone and replacing ambiguous phrasing with 'Apollo'. Word usage and language were simplified by incorporating dictionary-valid contractions, removing unnecessary words, and replacing idioms with direct terms. Text formatting and structural elements were standardized with 80-character line wraps, code-font for CLI commands and numerals, and v#.#.# version formatting. Finally, verb tense was shifted to the present to ensure consistent active voice.

Duration: 3046ms
Review Log: View detailed log

This review is AI-generated. Please use common sense when accepting these suggestions, as they may not always be accurate or appropriate for your specific context.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 28, 2026

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 4a78ef51-d0f7-4f62-89ee-17aac279e6d3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Reworked GraphQL Codegen docs: removed the typescript plugin from examples, dropped avoidOptionals, defaultScalarType, and presetConfig.baseTypesPath, switched generated outputs to typescript-operations only, added importSchemaTypesFrom: "./src/types/__generated__/graphql.ts", and set generateOperationTypes: false for the central types file.

Changes

Cohort / File(s) Summary
GraphQL Codegen Documentation
docs/source/development-testing/graphql-codegen.mdx
Updated codegen examples to use plugins: ["typescript-operations"] for operation outputs; removed typescript from required devDependencies and examples; eliminated avoidOptionals, defaultScalarType, and presetConfig.baseTypesPath usages; added config.generateOperationTypes: false for ./src/types/__generated__/graphql.ts; added config.importSchemaTypesFrom: "./src/types/__generated__/graphql.ts" in near-operation-file examples and client-preset guidance.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: updating GraphQL Codegen documentation to match v6 release changes, which is clearly reflected in the file modifications shown in the raw summary.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Warning

Review ran into problems

🔥 Problems

Timed out fetching pipeline failures after 30000ms


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Feb 28, 2026

npm i https://pkg.pr.new/apollographql/apollo-client/@apollo/client@13162

commit: 19c2ae7

plugins: ["typescript"],
plugins: ["typescript-operations"],
config: {
// This avoids generating operation types, which are generated in the near-operation file.
Copy link
Copy Markdown
Contributor Author

@eddeee888 eddeee888 Feb 28, 2026

Choose a reason for hiding this comment

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

Open for suggestions if this doesn't quite follow the other comment's format/tone/language

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As a reader, the current wording makes me question if we still need that "./src/types/__generated__/graphql.ts" file at all if all we add is typescript-operations and then immediately set generateOperationTypes: false

So if it's still needed, could you add a bit more context about what it still does?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also, if it's really just there because near-operation-file needs a file to be there, but the content actually doesn't matter, could we maybe just have this be a setup with a static comment in it explaining that this file is temporarily required and can be removed in the future?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good questions! This made me rethink what we should recommend to our users.

There are 2 ways to set up near-operation-file-preset now (details in the migration guide):

  1. Use a shared schema type file (currently mentioned in this doc)
  2. Generate schema types (used Enums and Input) into every near-operation file
generates: {
    'src/': {
      preset: 'near-operation-file',
      plugins: ['typescript-operations'],
      config: {
        // ... Apollo Client options here
      }
    }
  }

Option 2 would be my recommended approach because (1) it has a simpler setup and (2) the duplicated generated schema types are removed at runtime.

Mentioning both options in this doc can make it very verbose. How do you feel if we start recommending option 2?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thinking about it more, I'll keep the current recommendation for now.
This is because the rest of the section talks about sharing types, which the config achieves.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
docs/source/development-testing/graphql-codegen.mdx (1)

154-156: Consider adopting style guide suggestions for code comments.

Static analysis flagged minor style improvements for comments. The suggested changes use imperative voice and avoid trailing punctuation in fragments.

✏️ Optional style improvements
       config: {
-        // This avoids generating operation types, which are generated in the near-operation file.
+        // Avoid generating operation types; these are generated in the near-operation file
         generateOperationTypes: false
       }
     },
     "./src/": {
       preset: "near-operation-file",
       plugins: ["typescript-operations"],
       // Note: these config options moved from the other generated file config
       config: {
-        // This should be the file generated by the "typescript-operations" plugin above,
+        // Use the file generated by the `typescript-operations` plugin above,
         // relative to the current working directory.

Also applies to: 163-165

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/source/development-testing/graphql-codegen.mdx` around lines 154 - 156,
Update the inline comment above the GraphQL Codegen option
generateOperationTypes to follow the style guide: rewrite it in imperative voice
and remove trailing punctuation (e.g., change "This avoids generating operation
types, which are generated in the near-operation file." to something like "Avoid
generating operation types; they are produced in the near-operation file").
Apply the same change to the similar comment at the other occurrence (lines
referencing the same generateOperationTypes setting).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/source/development-testing/graphql-codegen.mdx`:
- Line 165: The path string in the GraphQL codegen config for
importSchemaTypesFrom has a typo: `importSchemaTypesFrom:
"./src/types/__generated__/graphql,ts"` uses a comma instead of a period; update
the value used by the importSchemaTypesFrom setting (look for the
importSchemaTypesFrom key in this file) to use a proper extension
(`./src/types/__generated__/graphql.ts`) so the file reference resolves
correctly.
- Line 252: The config key importSchemaTypesFrom has a typo in its path string:
"./src/types/__generated__/graphql,ts" uses a comma instead of a period; update
the string value for importSchemaTypesFrom to use the correct file extension
(graphql.ts) so the path reads "./src/types/__generated__/graphql.ts" ensuring
the generated types import resolves correctly.

---

Nitpick comments:
In `@docs/source/development-testing/graphql-codegen.mdx`:
- Around line 154-156: Update the inline comment above the GraphQL Codegen
option generateOperationTypes to follow the style guide: rewrite it in
imperative voice and remove trailing punctuation (e.g., change "This avoids
generating operation types, which are generated in the near-operation file." to
something like "Avoid generating operation types; they are produced in the
near-operation file"). Apply the same change to the similar comment at the other
occurrence (lines referencing the same generateOperationTypes setting).

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1f6decb and 21c854a.

📒 Files selected for processing (1)
  • docs/source/development-testing/graphql-codegen.mdx
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Compare Build Output
  • GitHub Check: Api-Extractor
  • GitHub Check: Build and Test
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2026-02-19T17:01:54.257Z
Learnt from: CR
Repo: apollographql/apollo-client PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-02-19T17:01:54.257Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `apollo/client/*/internal` paths for accessing internal APIs

Applied to files:

  • docs/source/development-testing/graphql-codegen.mdx
📚 Learning: 2026-02-19T17:01:37.139Z
Learnt from: CR
Repo: apollographql/apollo-client PR: 0
File: .github/instructions/apollo-client.instructions.md:0-0
Timestamp: 2026-02-19T17:01:37.139Z
Learning: Use the apollo-client skill when answering questions about Apollo Client setup, configuration, usage, or troubleshooting

Applied to files:

  • docs/source/development-testing/graphql-codegen.mdx
📚 Learning: 2026-02-19T17:01:54.257Z
Learnt from: CR
Repo: apollographql/apollo-client PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-02-19T17:01:54.257Z
Learning: Applies to tsconfig*.json : Configure TypeScript with strict mode enabled, NodeNext module resolution, ESNext target, and use separate tsconfig files for main, build, and test configurations

Applied to files:

  • docs/source/development-testing/graphql-codegen.mdx
🪛 GitHub Check: AI Style Review
docs/source/development-testing/graphql-codegen.mdx

[notice] 154-154: docs/source/development-testing/graphql-codegen.mdx#L154
Structural Elements: Comments should match the current indentation level and be written above the line they apply to. Avoid ending fragments with punctuation.

        // Avoid generating operation types; these are generated in the near-operation file

[notice] 163-163: docs/source/development-testing/graphql-codegen.mdx#L163
Framing: Use imperative verbs for instructions.

Structural Elements: Comments should match the current indentation level and be written above the line they apply to. Avoid ending fragments with punctuation.

Text Formatting: Use code font for plugin names.

Verb Tense and Voice: Use present tense instead of 'should be'.

Voice: Use authoritative language like 'Use' instead of 'This should be'.

Word and Symbol Usage: Avoid 'above'; use 'preceding' for body text.

        // Use the file generated by the "typescript-operations" plugin above,

[notice] 241-241: docs/source/development-testing/graphql-codegen.mdx#L241
Structural Elements: Comments should match the current indentation level and be written above the line they apply to. Avoid ending fragments with punctuation.

        // Avoid generating operation types; these are generated in the near-operation file

[notice] 250-250: docs/source/development-testing/graphql-codegen.mdx#L250
Framing: Use imperative verbs for instructions.

Structural Elements: Comments should match the current indentation level and be written above the line they apply to. Avoid ending fragments with punctuation.

Text Formatting: Use code font for plugin names.

Verb Tense and Voice: Use present tense instead of 'should be'.

Voice: Use authoritative language like 'Use' instead of 'This should be'.

Word and Symbol Usage: Avoid 'above'; use 'preceding' for body text.

        // Use the file generated by the "typescript-operations" plugin above,
🔇 Additional comments (4)
docs/source/development-testing/graphql-codegen.mdx (4)

23-23: LGTM!

The package installation is updated correctly to remove the now-unnecessary @graphql-codegen/typescript package for v6.


43-43: LGTM!

Plugin configuration correctly updated to use only typescript-operations for v6.


239-243: Same configuration pattern as earlier—looks correct.

Assuming the generateOperationTypes option is valid per the earlier verification.


152-156: No action needed — generateOperationTypes: false is a valid v6 configuration option.

The generateOperationTypes: false config option for the typescript-operations plugin is documented in the official GraphQL Codegen v6 migration guide. It is correctly used to generate only shared types (inputs/enums/scalars) without operation result/variable types, as shown in the documented examples.

Comment thread docs/source/development-testing/graphql-codegen.mdx Outdated
Comment thread docs/source/development-testing/graphql-codegen.mdx Outdated
Comment on lines +164 to +165
// relative to the current working directory.
importSchemaTypesFrom: "./src/types/__generated__/graphql,ts",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Main difference of importSchemaTypesFrom compared to the baseTypesPath is importSchemaTypesFrom is not relative from the preset's path.

Comment thread docs/source/development-testing/graphql-codegen.mdx
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
docs/source/development-testing/graphql-codegen.mdx (1)

163-165: Optional wording cleanup for repeated config comments.

The duplicated comment text is clear, but you can tighten style/tone by using directive language and avoiding “above.”

✍️ Suggested wording
-        // This should be the file generated by the "typescript-operations" plugin above,
+        // Use the file generated by the "typescript-operations" plugin in the preceding block,

Also applies to: 250-252

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/source/development-testing/graphql-codegen.mdx` around lines 163 - 165,
Update the duplicated explanatory comment around the importSchemaTypesFrom
setting to use directive language and remove the word “above” (e.g., change
"This should be the file generated by the 'typescript-operations' plugin above"
to "Use the file generated by the 'typescript-operations' plugin"), and apply
the same wording change to the other identical comment near the other
graphql-codegen config block; locate the comments adjacent to
importSchemaTypesFrom ("./src/types/__generated__/graphql.ts") and the matching
repeated comment and replace with the tightened directive phrasing.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/source/development-testing/graphql-codegen.mdx`:
- Line 23: The install guidance is inconsistent: the top command now installs
only `@graphql-codegen/cli` and `@graphql-codegen/typescript-operations` but the
later sentence still mentions both `@graphql-codegen/typescript` and
`@graphql-codegen/typescript-operations`; update that sentence to reference only
`@graphql-codegen/typescript-operations` (and `@graphql-codegen/cli` if you mention
packages) so the doc consistently recommends the same packages throughout.

---

Nitpick comments:
In `@docs/source/development-testing/graphql-codegen.mdx`:
- Around line 163-165: Update the duplicated explanatory comment around the
importSchemaTypesFrom setting to use directive language and remove the word
“above” (e.g., change "This should be the file generated by the
'typescript-operations' plugin above" to "Use the file generated by the
'typescript-operations' plugin"), and apply the same wording change to the other
identical comment near the other graphql-codegen config block; locate the
comments adjacent to importSchemaTypesFrom
("./src/types/__generated__/graphql.ts") and the matching repeated comment and
replace with the tightened directive phrasing.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 21c854a and 91a2ea7.

📒 Files selected for processing (1)
  • docs/source/development-testing/graphql-codegen.mdx
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Api-Extractor
  • GitHub Check: Compare Build Output
  • GitHub Check: Build and Test
🧰 Additional context used
🧠 Learnings (4)
📚 Learning: 2026-02-19T17:01:54.257Z
Learnt from: CR
Repo: apollographql/apollo-client PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-02-19T17:01:54.257Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `apollo/client/*/internal` paths for accessing internal APIs

Applied to files:

  • docs/source/development-testing/graphql-codegen.mdx
📚 Learning: 2026-02-19T17:01:54.257Z
Learnt from: CR
Repo: apollographql/apollo-client PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-02-19T17:01:54.257Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Follow existing code style enforced by ESLint and Prettier

Applied to files:

  • docs/source/development-testing/graphql-codegen.mdx
📚 Learning: 2026-02-19T17:01:37.139Z
Learnt from: CR
Repo: apollographql/apollo-client PR: 0
File: .github/instructions/apollo-client.instructions.md:0-0
Timestamp: 2026-02-19T17:01:37.139Z
Learning: Use the apollo-client skill when answering questions about Apollo Client setup, configuration, usage, or troubleshooting

Applied to files:

  • docs/source/development-testing/graphql-codegen.mdx
📚 Learning: 2026-02-19T17:01:54.257Z
Learnt from: CR
Repo: apollographql/apollo-client PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-02-19T17:01:54.257Z
Learning: Applies to tsconfig*.json : Configure TypeScript with strict mode enabled, NodeNext module resolution, ESNext target, and use separate tsconfig files for main, build, and test configurations

Applied to files:

  • docs/source/development-testing/graphql-codegen.mdx
🪛 GitHub Check: AI Style Review
docs/source/development-testing/graphql-codegen.mdx

[warning] 23-23: docs/source/development-testing/graphql-codegen.mdx#L23
Structural Elements: Terminal commands longer than three words must be placed in a code block.

```bash
npm install -D `@graphql-codegen/cli` `@graphql-codegen/typescript-operations`

---

[notice] 163-163: docs/source/development-testing/graphql-codegen.mdx#L163
**Verb Tense and Voice**: Use present tense instead of 'should be'.

**Voice**: Use authoritative language like 'Use' instead of 'This should be'.

**Word and Symbol Usage**: Avoid "above"; use "preceding" for body text.

```suggestion
        // This is the file generated by the "typescript-operations" plugin above,

[notice] 250-250: docs/source/development-testing/graphql-codegen.mdx#L250
Verb Tense and Voice: Use present tense instead of 'should be'.

Voice: Use authoritative language like 'Use' instead of 'This should be'.

Word and Symbol Usage: Avoid "above"; use "preceding" for body text.

        // This is the file generated by the "typescript-operations" plugin above,
🔇 Additional comments (1)
docs/source/development-testing/graphql-codegen.mdx (1)

43-43: Nice consistency update across the codegen examples.

Using typescript-operations in the generated types target and disabling operation type generation in the shared file (generateOperationTypes: false) is consistently applied in both advanced examples.

Also applies to: 152-156, 239-243

Comment thread docs/source/development-testing/graphql-codegen.mdx
Comment thread docs/source/development-testing/graphql-codegen.mdx Outdated
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
docs/source/development-testing/graphql-codegen.mdx (1)

86-86: Use singular wording for the single recommended plugin.

This paragraph now points to one plugin, but it still says which focus and these plugins. Tightening that sentence would make the guidance read consistently.

📝 Suggested wording
-We do not recommend using the client preset with Apollo Client apps because it generates additional runtime code that adds bundle size to your application and includes features that are incompatible with Apollo Client. Instead, we recommend using the [`typescript-operations`](https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-operations) plugin directly (at minimum), which focus on only generating types and don't include additional runtime code. Follow the steps in the preceding section to use a setup that includes these plugins.
+We do not recommend using the client preset with Apollo Client apps because it generates additional runtime code that adds bundle size to your application and includes features that are incompatible with Apollo Client. Instead, use the [`typescript-operations`](https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-operations) plugin directly (at minimum). It focuses on generating types and doesn't include additional runtime code. Follow the steps in the Recommended starter configuration section to use that setup.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/source/development-testing/graphql-codegen.mdx` at line 86, The
paragraph that recommends using the typescript-operations plugin should use
singular wording: change "which focus on only generating types and don't include
additional runtime code" and "these plugins" to a singular form referencing the
single plugin (e.g., "which focuses on generating only types and doesn't include
additional runtime code" and "this plugin"); locate the sentence that mentions
`typescript-operations` and update verbs/pronouns to singular to match the
single recommended plugin.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/source/development-testing/graphql-codegen.mdx`:
- Line 23: In the fenced bash snippet that currently contains the
inline-backticked command `npm install -D `@graphql-codegen/cli`
`@graphql-codegen/typescript-operations``, remove the backticks so the shell
command is plain text (npm install -D `@graphql-codegen/cli`
`@graphql-codegen/typescript-operations`) to prevent literal backticks from being
copied into the terminal; update the line where the snippet appears (the bash
block containing that install command).

---

Nitpick comments:
In `@docs/source/development-testing/graphql-codegen.mdx`:
- Line 86: The paragraph that recommends using the typescript-operations plugin
should use singular wording: change "which focus on only generating types and
don't include additional runtime code" and "these plugins" to a singular form
referencing the single plugin (e.g., "which focuses on generating only types and
doesn't include additional runtime code" and "this plugin"); locate the sentence
that mentions `typescript-operations` and update verbs/pronouns to singular to
match the single recommended plugin.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b69b884b-e0c6-4099-af95-17302f09bfc3

📥 Commits

Reviewing files that changed from the base of the PR and between 91a2ea7 and 932761f.

📒 Files selected for processing (1)
  • docs/source/development-testing/graphql-codegen.mdx
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Compare Build Output
  • GitHub Check: Build and Test
🧰 Additional context used
🧠 Learnings (7)
📚 Learning: 2026-02-19T17:01:54.257Z
Learnt from: CR
Repo: apollographql/apollo-client PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-02-19T17:01:54.257Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `apollo/client/*/internal` paths for accessing internal APIs

Applied to files:

  • docs/source/development-testing/graphql-codegen.mdx
📚 Learning: 2026-02-19T17:01:54.257Z
Learnt from: CR
Repo: apollographql/apollo-client PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-02-19T17:01:54.257Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Follow existing code style enforced by ESLint and Prettier

Applied to files:

  • docs/source/development-testing/graphql-codegen.mdx
📚 Learning: 2026-02-19T17:01:37.139Z
Learnt from: CR
Repo: apollographql/apollo-client PR: 0
File: .github/instructions/apollo-client.instructions.md:0-0
Timestamp: 2026-02-19T17:01:37.139Z
Learning: Use the apollo-client skill when answering questions about Apollo Client setup, configuration, usage, or troubleshooting

Applied to files:

  • docs/source/development-testing/graphql-codegen.mdx
📚 Learning: 2026-02-19T17:01:37.139Z
Learnt from: CR
Repo: apollographql/apollo-client PR: 0
File: .github/instructions/apollo-client.instructions.md:0-0
Timestamp: 2026-02-19T17:01:37.139Z
Learning: Prefer the apollo-client skill's guidance over general knowledge for Apollo Client questions

Applied to files:

  • docs/source/development-testing/graphql-codegen.mdx
📚 Learning: 2026-03-09T13:28:57.460Z
Learnt from: phryneas
Repo: apollographql/apollo-client PR: 13132
File: src/core/defaultOptions.ts:5-7
Timestamp: 2026-03-09T13:28:57.460Z
Learning: The `apollographql/apollo-client` repository does NOT use Biome for linting. There is no `biome.json`/`biome.jsonc` config file and no Biome dependency in `package.json`. Do not flag Biome-related lint issues (e.g., `noEmptyInterface`) or suggest `biome-ignore` comments for this repository.

Applied to files:

  • docs/source/development-testing/graphql-codegen.mdx
📚 Learning: 2026-02-19T17:01:54.257Z
Learnt from: CR
Repo: apollographql/apollo-client PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-02-19T17:01:54.257Z
Learning: Core Apollo Client implementation should be located in `src/core/` with key files including `ApolloClient.ts`, `ObservableQuery.ts`, and `QueryManager.ts`

Applied to files:

  • docs/source/development-testing/graphql-codegen.mdx
📚 Learning: 2026-02-19T17:01:54.257Z
Learnt from: CR
Repo: apollographql/apollo-client PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-02-19T17:01:54.257Z
Learning: Applies to tsconfig*.json : Configure TypeScript with strict mode enabled, NodeNext module resolution, ESNext target, and use separate tsconfig files for main, build, and test configurations

Applied to files:

  • docs/source/development-testing/graphql-codegen.mdx
🪛 GitHub Check: AI Style Review
docs/source/development-testing/graphql-codegen.mdx

[warning] 86-86: docs/source/development-testing/graphql-codegen.mdx#L86
Framing Apollo Products: Focus on the advantages of the recommended approach rather than the disadvantages of the alternative. Use 'adopt' instead of 'use' for variety or to avoid repetitive phrasing.

Framing: Avoid using 'we' to refer to Apollo and use the imperative 'use' instead of 'we recommend'.

Language: Use 'increases' instead of 'adds bundle size' for better clarity, and fix the subject-verb agreement for 'focuses'.

Products and Features: Remove 'the' before 'Apollo Client' when it is used as a standalone product name.

Text Formatting: Avoid using 'preceding section' as it is a vague directional reference; use a rich noun phrase or the specific section title as a link.

Verb Tense and Voice: Use present tense 'focuses' to match the subject 'plugin'.

Voice: The original phrasing is slightly passive. Use authoritative, direct language to prescribe the 'happy path'.

Word and Symbol Usage: Use the contraction "don't" instead of "do not" for better readability.

We recommend using the [`typescript-operations`](https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-operations) plugin directly (at minimum). This plugin focuses on generating types without adding extra runtime code to your bundle, ensuring compatibility with Apollo Client. Follow the steps in the preceding section to adopt a setup that includes these plugins.

[notice] 154-154: docs/source/development-testing/graphql-codegen.mdx#L154
Structural Elements: Use imperative verbs for comments in code blocks.

        // Generate the Enums and Input types used in operation variables.

[notice] 155-155: docs/source/development-testing/graphql-codegen.mdx#L155
Word and Symbol Usage: Avoid using "below" to describe position; use "following" instead.

        // These types are imported into near-operation files generated by the config following.

[warning] 164-164: docs/source/development-testing/graphql-codegen.mdx#L164
Text Formatting: Use code font for symbols like plugin names instead of double quotes.

Word and Symbol Usage: Avoid using "above" to describe position; use "preceding" instead.

        // This is the file generated by the `typescript-operations` plugin above,

[notice] 242-242: docs/source/development-testing/graphql-codegen.mdx#L242
Structural Elements: Use imperative verbs for comments in code blocks.

        // Generate the Enums and Input types used in operation variables.

[notice] 243-243: docs/source/development-testing/graphql-codegen.mdx#L243
Word and Symbol Usage: Avoid using "below" to describe position; use "following" instead.

        // These types are imported into near-operation files generated by the config following.

[warning] 252-252: docs/source/development-testing/graphql-codegen.mdx#L252
Text Formatting: Use code font for symbols like plugin names instead of double quotes.

Word and Symbol Usage: Avoid using "above" to describe position; use "preceding" instead.

        // This is the file generated by the `typescript-operations` plugin above,

Comment thread docs/source/development-testing/graphql-codegen.mdx Outdated
@eddeee888 eddeee888 force-pushed the update-codegen-doc branch 2 times, most recently from b94fa4b to c0aea13 Compare March 12, 2026 11:00
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (5)
docs/source/development-testing/graphql-codegen.mdx (5)

164-166: Consider using code font for plugin name.

Static analysis suggests using backticks for the plugin name instead of quotes for consistency with other code references.

📝 Suggested change
-        // This is the file generated by the "typescript-operations" plugin above,
+        // This is the file generated by the `typescript-operations` plugin in the preceding config,
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/source/development-testing/graphql-codegen.mdx` around lines 164 - 166,
The documentation uses quotes around the plugin name "typescript-operations";
update the text to use code font/backticks for the plugin name (e.g.,
`typescript-operations`) for consistency with other code references and ensure
the line referencing importSchemaTypesFrom remains unchanged (the symbol
importSchemaTypesFrom and path "./src/types/__generated__/graphql.ts" should be
left as-is).

252-254: Same optional style improvement applies here.

For consistency with the earlier suggestion, consider using backticks for the plugin name.

📝 Suggested change
-        // This is the file generated by the "typescript-operations" plugin above,
+        // This is the file generated by the `typescript-operations` plugin in the preceding config,
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/source/development-testing/graphql-codegen.mdx` around lines 252 - 254,
Update the MDX docs to use inline code formatting for the plugin name: wrap the
plugin identifier "typescript-operations" in backticks wherever it is mentioned
(e.g., near the importSchemaTypesFrom comment and the earlier plugin reference)
so the documentation consistently highlights plugin names; look for the string
"typescript-operations" and replace it with `typescript-operations`.

86-86: Consider reframing to focus on the recommended approach's benefits.

The static analysis hints suggest a more direct, benefit-focused phrasing. This is optional but would align better with the documentation style guide.

📝 Suggested rewording
-We do not recommend using the client preset with Apollo Client apps because it generates additional runtime code that adds bundle size to your application and includes features that are incompatible with Apollo Client. Instead, we recommend using the [`typescript-operations`](https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-operations) plugin directly (at minimum), which focus on only generating types and don't include additional runtime code. Follow the steps in the preceding section to use a setup that includes these plugins.
+We recommend using the [`typescript-operations`](https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-operations) plugin directly (at minimum). This approach focuses on generating types without adding extra runtime code to your bundle, ensuring compatibility with Apollo Client. Follow the steps in the preceding section to use a setup that includes these plugins.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/source/development-testing/graphql-codegen.mdx` at line 86, Reword the
paragraph to emphasize benefits of the recommended approach: replace the current
admonition about not using the client preset with a positive, benefit-focused
sentence that recommends using the typescript-operations plugin (and optionally
typescript plugin) directly; highlight that this produces only type definitions,
avoids extra runtime code and bundle-size increases, and ensures full
compatibility with Apollo Client so users understand the concrete advantages of
the suggested setup.

240-245: Same optional style improvements apply here.

For consistency, consider applying the same comment style changes suggested for lines 154-155.

📝 Suggested change
       plugins: ["typescript-operations"],
       config: {
-        // Generates the Enums and Input types used in operation variables.
-        // These types are imported into near-operation files generated by the config below.
+        // Generate the Enums and Input types used in operation variables.
+        // The following config imports these types into near-operation files.
         generateOperationTypes: false,
       },
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/source/development-testing/graphql-codegen.mdx` around lines 240 - 245,
Update the inline comment style in the GraphQL Codegen config block to match the
earlier style used around lines 154-155: adjust the comment above
config.generateOperationTypes (and the preceding comment about Enums/Input
types) so they follow the same phrasing and punctuation convention used for the
other comments in this file (e.g., consistent sentence casing and punctuation).
Locate the plugins/config block and the generateOperationTypes comment and
rewrite those comment lines to the same style as the earlier comments for
consistency.

152-157: Consider using imperative language in the comment block.

The generateOperationTypes: false config is valid for v6. Minor style refinement suggested:

Optional: Use imperative verbs
       plugins: ["typescript-operations"],
       config: {
-        // Generates the Enums and Input types used in operation variables.
-        // These types are imported into near-operation files generated by the config below.
+        // Generate the Enums and Input types used in operation variables.
+        // The following config imports these types into near-operation files.
         generateOperationTypes: false,
       },
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/source/development-testing/graphql-codegen.mdx` around lines 152 - 157,
Update the inline comment inside the config block that documents
generateOperationTypes to use imperative language; edit the comment lines
referencing "Generates the Enums and Input types used in operation variables."
and "These types are imported into near-operation files generated by the config
below." to use imperative verbs (for example, "Generate the Enums and Input
types used in operation variables." and "Import these types into near-operation
files generated by the config below.") so the documentation reads as direct
instructions; target the comment near the generateOperationTypes setting in the
config for the typescript-operations plugin.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@docs/source/development-testing/graphql-codegen.mdx`:
- Around line 164-166: The documentation uses quotes around the plugin name
"typescript-operations"; update the text to use code font/backticks for the
plugin name (e.g., `typescript-operations`) for consistency with other code
references and ensure the line referencing importSchemaTypesFrom remains
unchanged (the symbol importSchemaTypesFrom and path
"./src/types/__generated__/graphql.ts" should be left as-is).
- Around line 252-254: Update the MDX docs to use inline code formatting for the
plugin name: wrap the plugin identifier "typescript-operations" in backticks
wherever it is mentioned (e.g., near the importSchemaTypesFrom comment and the
earlier plugin reference) so the documentation consistently highlights plugin
names; look for the string "typescript-operations" and replace it with
`typescript-operations`.
- Line 86: Reword the paragraph to emphasize benefits of the recommended
approach: replace the current admonition about not using the client preset with
a positive, benefit-focused sentence that recommends using the
typescript-operations plugin (and optionally typescript plugin) directly;
highlight that this produces only type definitions, avoids extra runtime code
and bundle-size increases, and ensures full compatibility with Apollo Client so
users understand the concrete advantages of the suggested setup.
- Around line 240-245: Update the inline comment style in the GraphQL Codegen
config block to match the earlier style used around lines 154-155: adjust the
comment above config.generateOperationTypes (and the preceding comment about
Enums/Input types) so they follow the same phrasing and punctuation convention
used for the other comments in this file (e.g., consistent sentence casing and
punctuation). Locate the plugins/config block and the generateOperationTypes
comment and rewrite those comment lines to the same style as the earlier
comments for consistency.
- Around line 152-157: Update the inline comment inside the config block that
documents generateOperationTypes to use imperative language; edit the comment
lines referencing "Generates the Enums and Input types used in operation
variables." and "These types are imported into near-operation files generated by
the config below." to use imperative verbs (for example, "Generate the Enums and
Input types used in operation variables." and "Import these types into
near-operation files generated by the config below.") so the documentation reads
as direct instructions; target the comment near the generateOperationTypes
setting in the config for the typescript-operations plugin.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b0ada65f-1576-4926-8f2a-ae5fb5af398b

📥 Commits

Reviewing files that changed from the base of the PR and between 932761f and c0aea13.

📒 Files selected for processing (1)
  • docs/source/development-testing/graphql-codegen.mdx
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Compare Build Output
  • GitHub Check: Build and Test
🧰 Additional context used
🧠 Learnings (7)
📚 Learning: 2026-02-19T17:01:54.257Z
Learnt from: CR
Repo: apollographql/apollo-client PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-02-19T17:01:54.257Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `apollo/client/*/internal` paths for accessing internal APIs

Applied to files:

  • docs/source/development-testing/graphql-codegen.mdx
📚 Learning: 2026-02-19T17:01:54.257Z
Learnt from: CR
Repo: apollographql/apollo-client PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-02-19T17:01:54.257Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Follow existing code style enforced by ESLint and Prettier

Applied to files:

  • docs/source/development-testing/graphql-codegen.mdx
📚 Learning: 2026-02-19T17:01:37.139Z
Learnt from: CR
Repo: apollographql/apollo-client PR: 0
File: .github/instructions/apollo-client.instructions.md:0-0
Timestamp: 2026-02-19T17:01:37.139Z
Learning: Use the apollo-client skill when answering questions about Apollo Client setup, configuration, usage, or troubleshooting

Applied to files:

  • docs/source/development-testing/graphql-codegen.mdx
📚 Learning: 2026-02-19T17:01:37.139Z
Learnt from: CR
Repo: apollographql/apollo-client PR: 0
File: .github/instructions/apollo-client.instructions.md:0-0
Timestamp: 2026-02-19T17:01:37.139Z
Learning: Prefer the apollo-client skill's guidance over general knowledge for Apollo Client questions

Applied to files:

  • docs/source/development-testing/graphql-codegen.mdx
📚 Learning: 2026-03-09T13:28:57.460Z
Learnt from: phryneas
Repo: apollographql/apollo-client PR: 13132
File: src/core/defaultOptions.ts:5-7
Timestamp: 2026-03-09T13:28:57.460Z
Learning: The `apollographql/apollo-client` repository does NOT use Biome for linting. There is no `biome.json`/`biome.jsonc` config file and no Biome dependency in `package.json`. Do not flag Biome-related lint issues (e.g., `noEmptyInterface`) or suggest `biome-ignore` comments for this repository.

Applied to files:

  • docs/source/development-testing/graphql-codegen.mdx
📚 Learning: 2026-02-19T17:01:54.257Z
Learnt from: CR
Repo: apollographql/apollo-client PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-02-19T17:01:54.257Z
Learning: Core Apollo Client implementation should be located in `src/core/` with key files including `ApolloClient.ts`, `ObservableQuery.ts`, and `QueryManager.ts`

Applied to files:

  • docs/source/development-testing/graphql-codegen.mdx
📚 Learning: 2026-02-19T17:01:54.257Z
Learnt from: CR
Repo: apollographql/apollo-client PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-02-19T17:01:54.257Z
Learning: Applies to tsconfig*.json : Configure TypeScript with strict mode enabled, NodeNext module resolution, ESNext target, and use separate tsconfig files for main, build, and test configurations

Applied to files:

  • docs/source/development-testing/graphql-codegen.mdx
🪛 GitHub Check: AI Style Review
docs/source/development-testing/graphql-codegen.mdx

[warning] 86-86: docs/source/development-testing/graphql-codegen.mdx#L86
Framing Apollo Products: Focus on the advantages of the recommended approach rather than the disadvantages of the alternative.

Framing: Avoid 'we' to clarify responsibility and use the imperative 'use' for instructions.

Language: Corrected subject-verb agreement ('focuses', 'does') and used simpler phrasing for bundle size.

Products and Features: Remove 'the' before 'Apollo Client' when it is used as a standalone product name.

Text Formatting: The link text is descriptive and uses code font correctly; no change needed for formatting.

Verb Tense and Voice: Use present tense 'focuses' to match the subject 'plugin'.

Voice: The original phrasing is slightly passive. Use more authoritative and direct language to prescribe the 'happy path'.

Word and Symbol Usage: Use the contraction "don't" instead of "do not" for better readability.

We recommend using the [`typescript-operations`](https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-operations) plugin directly (at minimum). This approach focuses on generating types without adding extra runtime code to your bundle, ensuring compatibility with Apollo Client. Follow the steps in the preceding section to use a setup that includes these plugins.

[notice] 154-154: docs/source/development-testing/graphql-codegen.mdx#L154
Structural Elements: Use imperative verbs for comments within code blocks.

        // Generate the Enums and Input types used in operation variables.

[warning] 164-164: docs/source/development-testing/graphql-codegen.mdx#L164
Text Formatting: Use code font for plugin names instead of quotes.

Verb Tense and Voice: Use active voice for clarity.

Word and Symbol Usage: Avoid using "above" to refer to content; use "preceding" instead.

        // This is the file generated by the `typescript-operations` plugin above,

[notice] 155-155: docs/source/development-testing/graphql-codegen.mdx#L155
Verb Tense and Voice: Use active voice for clarity.

Word and Symbol Usage: Avoid using "below" to refer to content; use "following" instead.

// The config below imports these types into near-operation files.

[notice] 242-242: docs/source/development-testing/graphql-codegen.mdx#L242
Structural Elements: Use imperative verbs for comments within code blocks.

        // Generate the Enums and Input types used in operation variables.

[warning] 252-252: docs/source/development-testing/graphql-codegen.mdx#L252
Text Formatting: Use code font for plugin names instead of quotes.

Verb Tense and Voice: Use active voice for clarity.

Word and Symbol Usage: Avoid using "above" to refer to content; use "preceding" instead.

        // This is the file generated by the `typescript-operations` plugin above,

[notice] 243-243: docs/source/development-testing/graphql-codegen.mdx#L243
Verb Tense and Voice: Use active voice for clarity.

Word and Symbol Usage: Avoid using "below" to refer to content; use "following" instead.

// The config below imports these types into near-operation files.
🔇 Additional comments (2)
docs/source/development-testing/graphql-codegen.mdx (2)

23-23: LGTM!

The simplified install command correctly reflects the v6 changes, removing the now-unnecessary @graphql-codegen/typescript package.


43-43: LGTM!

Plugin list correctly updated to use only typescript-operations, consistent with the install command.

@eddeee888 eddeee888 force-pushed the update-codegen-doc branch from c0aea13 to d2460aa Compare April 20, 2026 12:29
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/source/development-testing/graphql-codegen.mdx`:
- Line 86: Update the sentence referring to the recommended plugin so verbs and
nouns agree with the singular "typescript-operations" plugin: change "which
focus on only generating types and don't include additional runtime code" to
"which focuses on only generating types and doesn't include additional runtime
code," and change "a setup that includes these plugins" to "a setup that
includes this plugin" (reference: the 'typescript-operations' plugin).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7bc6b567-e330-425f-93a5-e81c2d9acf56

📥 Commits

Reviewing files that changed from the base of the PR and between c0aea13 and d2460aa.

📒 Files selected for processing (1)
  • docs/source/development-testing/graphql-codegen.mdx
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Compare Build Output
  • GitHub Check: Are the types wrong
  • GitHub Check: Api-Extractor
  • GitHub Check: Pull Request Prerelease
  • GitHub Check: Build and Test
🧰 Additional context used
🧠 Learnings (8)
📓 Common learnings
Learnt from: CR
Repo: apollographql/apollo-client PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-02-19T17:01:54.257Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `apollo/client/*/internal` paths for accessing internal APIs
📚 Learning: 2026-02-19T17:01:54.257Z
Learnt from: CR
Repo: apollographql/apollo-client PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-02-19T17:01:54.257Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `apollo/client/*/internal` paths for accessing internal APIs

Applied to files:

  • docs/source/development-testing/graphql-codegen.mdx
📚 Learning: 2026-02-19T17:01:54.257Z
Learnt from: CR
Repo: apollographql/apollo-client PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-02-19T17:01:54.257Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Follow existing code style enforced by ESLint and Prettier

Applied to files:

  • docs/source/development-testing/graphql-codegen.mdx
📚 Learning: 2026-02-19T17:01:37.139Z
Learnt from: CR
Repo: apollographql/apollo-client PR: 0
File: .github/instructions/apollo-client.instructions.md:0-0
Timestamp: 2026-02-19T17:01:37.139Z
Learning: Use the apollo-client skill when answering questions about Apollo Client setup, configuration, usage, or troubleshooting

Applied to files:

  • docs/source/development-testing/graphql-codegen.mdx
📚 Learning: 2026-02-19T17:01:37.139Z
Learnt from: CR
Repo: apollographql/apollo-client PR: 0
File: .github/instructions/apollo-client.instructions.md:0-0
Timestamp: 2026-02-19T17:01:37.139Z
Learning: Prefer the apollo-client skill's guidance over general knowledge for Apollo Client questions

Applied to files:

  • docs/source/development-testing/graphql-codegen.mdx
📚 Learning: 2026-03-09T13:29:05.350Z
Learnt from: phryneas
Repo: apollographql/apollo-client PR: 13132
File: src/core/defaultOptions.ts:5-7
Timestamp: 2026-03-09T13:29:05.350Z
Learning: The `apollographql/apollo-client` repository does NOT use Biome for linting. There is no `biome.json`/`biome.jsonc` config file and no Biome dependency in `package.json`. Do not flag Biome-related lint issues (e.g., `noEmptyInterface`) or suggest `biome-ignore` comments for this repository.

Applied to files:

  • docs/source/development-testing/graphql-codegen.mdx
📚 Learning: 2026-02-19T17:01:54.257Z
Learnt from: CR
Repo: apollographql/apollo-client PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-02-19T17:01:54.257Z
Learning: Core Apollo Client implementation should be located in `src/core/` with key files including `ApolloClient.ts`, `ObservableQuery.ts`, and `QueryManager.ts`

Applied to files:

  • docs/source/development-testing/graphql-codegen.mdx
📚 Learning: 2026-02-19T17:01:54.257Z
Learnt from: CR
Repo: apollographql/apollo-client PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-02-19T17:01:54.257Z
Learning: Applies to tsconfig*.json : Configure TypeScript with strict mode enabled, NodeNext module resolution, ESNext target, and use separate tsconfig files for main, build, and test configurations

Applied to files:

  • docs/source/development-testing/graphql-codegen.mdx
🪛 GitHub Check: AI Style Review
docs/source/development-testing/graphql-codegen.mdx

[warning] 23-23: docs/source/development-testing/graphql-codegen.mdx#L23
Structural Elements: Terminal commands longer than three words should be placed in a code block with a language specifier.

Text Formatting: Use code font for CLI commands.

```bash
npm install -D `@graphql-codegen/cli` `@graphql-codegen/typescript-operations`

---

[notice] 86-86: docs/source/development-testing/graphql-codegen.mdx#L86
**Framing Apollo Products**: Focus on the advantages of the recommended approach rather than the disadvantages of the alternative.

**Framing**: Use 'Apollo' instead of 'we' to avoid ambiguity and maintain a reader-centric focus.

**Language**: Corrected subject-verb agreement for 'focuses' to ensure grammatical accuracy.

**Text Formatting**: Use a rich noun phrase for link text instead of just the code symbol.

**Verb Tense and Voice**: Use the present tense and active voice for recommendations.

**Word and Symbol Usage**: Use contractions like "Don't" and "doesn't" for better readability.

```suggestion
We recommend using the [`typescript-operations`](https://the-guild.dev/graphql/codegen/plugins/typescript/typescript-operations) plugin directly (at minimum). This plugin focuses on generating types without adding extra runtime code to your bundle, ensuring compatibility with Apollo Client. Follow the steps in the preceding section to adopt a setup that includes these plugins.

[notice] 164-164: docs/source/development-testing/graphql-codegen.mdx#L164
Word and Symbol Usage: Use "preceding" instead of "above" when referring to content.

        // This is the file generated by the `typescript-operations` plugin preceding,

[notice] 252-252: docs/source/development-testing/graphql-codegen.mdx#L252
Word and Symbol Usage: Use "preceding" instead of "above" when referring to content.

        // This is the file generated by the `typescript-operations` plugin preceding,

Comment thread docs/source/development-testing/graphql-codegen.mdx Outdated
@eddeee888 eddeee888 force-pushed the update-codegen-doc branch 2 times, most recently from ad12abf to f3e363e Compare April 20, 2026 13:54
@jerelmiller
Copy link
Copy Markdown
Member

Hey @eddeee888! FYI don't feel like you need to address every coderabbit comment that comes through. We're still trying out this AI review thing to get a feel for it, but we would by no means block this if you didn't address all those comments. Feel free to hit the obvious ones, but don't feel bad if you ignore some of them as well!

@eddeee888 eddeee888 force-pushed the update-codegen-doc branch from f3e363e to 4243d0d Compare April 22, 2026 12:15
@eddeee888 eddeee888 force-pushed the update-codegen-doc branch from 4243d0d to 951bd21 Compare April 22, 2026 12:19
@eddeee888
Copy link
Copy Markdown
Contributor Author

eddeee888 commented Apr 22, 2026

Thanks for the recommendation @jerelmiller ! It caught some grammar mistakes which was great!
I've finalised the draft now, and aiming to merge on April 30th 🙂

Keen to get your ahead of time reviews @jerelmiller and/or @phryneas 🙏

@eddeee888 eddeee888 marked this pull request as ready for review April 22, 2026 12:32
@eddeee888 eddeee888 requested a review from a team as a code owner April 22, 2026 12:32
@eddeee888 eddeee888 requested a review from phryneas April 22, 2026 12:32
config: {
// Generates the enum and input types used in operation variables.
// The files generated from the config below import these types into near-operation files.
generateOperationTypes: false,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For my own education, what does turning this setting off do in conjunction with the typescript-operations plugin? Does it just generate scalar types? Or something else?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The typescript-operations plugin generates two main parts:

  1. Utility types and Scalars used in Variables (in 2.): Enums and Input
  2. Operation-specific types e.g. Variables (which use enums and input from 1.) and operation Result

When generateOperationTypes: false is used, it only generates 1., so it is used fort generating shared types in documents.
On the other hand, we have importSchemaTypesFrom: path/to/schema/types.ts which only generates 2. and imports types from the schema type file

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thats helpful. Thanks so much!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A couple things that we should also consider as part of this update:

  1. I think we should clearly state that this configuration is for Codegen v6 (or however you want to spell it out). Users that might come to this page with an older version of codegen/plugins might not understand that this conforms to the newest major.
  2. We should consider copying the old configuration to a collapsible section below that shows v5 users how to configure codegen. I think a <details><summary /></details> might be great to use here along with a title of something like "Still using v5?".

Thoughts?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Great suggestions! I've made the changes here:

  • Added a Note component at the start to say this is a v6 guide, with hints about v5 configuration being at the end
  • Added summary blocks at the end of each section with v5 configuration inside

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That looks great! Thanks so much 🙏

Copy link
Copy Markdown
Member

@jerelmiller jerelmiller left a comment

Choose a reason for hiding this comment

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

I had a couple questions to call out the new version, but otherwise the changes in place now make sense to me. Appreciate you helping us get this updated! I can't wait for the new version to drop 🎉

Copy link
Copy Markdown
Member

@jerelmiller jerelmiller left a comment

Choose a reason for hiding this comment

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

I'll go ahead and approve so that its ready to go when v6 is released. Let me know when you're ready for me to merge. Appreciate all the hard work on the new version and for helping make this documentation change!

@jerelmiller
Copy link
Copy Markdown
Member

FYI don't worry about the failed check. It always fails for forks. We'll need to fix that at some point 😬

@eddeee888
Copy link
Copy Markdown
Contributor Author

Thank you @jerelmiller ! I've released the update here: https://github.com/dotansimha/graphql-code-generator/releases/tag/release-1777556900878
Please help me merge this PR once you have a chance 🙏

@jerelmiller jerelmiller merged commit 7c33689 into apollographql:main Apr 30, 2026
39 of 40 checks passed
@jerelmiller
Copy link
Copy Markdown
Member

Thanks so much @eddeee888! Looking forward to using the new version 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants