Skip to content

Update TypeScript documentation - #12835

Merged
jerelmiller merged 60 commits into
release-4.0from
jerel/ts-docs
Aug 18, 2025
Merged

Update TypeScript documentation#12835
jerelmiller merged 60 commits into
release-4.0from
jerel/ts-docs

Conversation

@jerelmiller

Copy link
Copy Markdown
Member

No description provided.

Comment thread docs/source/data/fragments.mdx Outdated
Comment thread docs/source/development-testing/static-typing.mdx Outdated
jerelmiller and others added 3 commits August 15, 2025 08:48
Co-authored-by: Lenz Weber-Tronic <lorenz.weber-tronic@apollographql.com>
Co-authored-by: Lenz Weber-Tronic <lorenz.weber-tronic@apollographql.com>
@jerelmiller jerelmiller changed the title [WIP] Update TypeScript documentation Update TypeScript documentation Aug 15, 2025
@jerelmiller
jerelmiller marked this pull request as ready for review August 15, 2025 16:29
@jerelmiller
jerelmiller requested a review from a team as a code owner August 15, 2025 16:29
@jerelmiller
jerelmiller requested a review from phryneas August 15, 2025 18:22

@phryneas phryneas left a comment

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.

Looking good to me altogether :)

Comment thread docs/source/data/fragments.mdx Outdated

</Note>

By default, Apollo Client uses GraphQL Codegen's [fragment masking](https://the-guild.dev/graphql/codegen/plugins/presets/preset-client#fragment-masking) output and orients its masking utility types around this format. If you aren't using GraphQL Codegen to generate your types, or your types are generated in a different format, the default type implementations built into Apollo Client might be incompatible which results in inaccurate types.

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.

This "by default" is not correct anymore.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I swear it was when I wrote this paragraph! 🤣🤣🤣

Let me workshop this a bit.

> This article assumes your project already uses TypeScript. If not, [configure your project to use TypeScript](https://github.com/Microsoft/TypeScript-React-Conversion-Guide#typescript-react-conversion-guide) or [start a new project](https://create-react-app.dev/docs/adding-typescript/).

To get started using GraphQL Code Generator, begin by installing the following packages (using Yarn or NPM):
Install the following packages. This installation assumes you already have [installed `@apollo/client` and its dependencies](../get-started#step-2-install-dependencies).

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.

This ends up with a very misleading TOC

image

That kinda implies we recommend the client preset.

How about

-## Setting up your project
## Setting up GraphQL Codegen
### Recommended starter configuration
### Notes about the Client preset

?

Also, we could generally need some more structure - some things are on the same level here when they should probably be nested deeper.

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.

All that said... do we maybe want to split this page into two?

One "setting up codegen" and one "using AC with TS"?

@jerelmiller jerelmiller Aug 18, 2025

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Let me start with the suggested change in navigation. I like that a lot and totally agree with you here. I'll time box separating these two into pages and agree it would read better with separate pages. I'll do a separate PR for that so we can at least get something out if we run out of time.

@jerelmiller
jerelmiller merged commit 777349b into release-4.0 Aug 18, 2025
31 of 33 checks passed
@jerelmiller
jerelmiller deleted the jerel/ts-docs branch August 18, 2025 18:26
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Sep 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants