-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Update TypeScript documentation #12835
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: Lenz Weber-Tronic <lorenz.weber-tronic@apollographql.com>
Co-authored-by: Lenz Weber-Tronic <lorenz.weber-tronic@apollographql.com>
6ce8958 to
c16a124
Compare
phryneas
left a comment
There was a problem hiding this comment.
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 :)
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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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). |
There was a problem hiding this comment.
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
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.
There was a problem hiding this comment.
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"?
There was a problem hiding this comment.
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.
No description provided.