-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
docs: minor 3.9 docs copyedits #11636
Conversation
|
@@ -1,6 +1,6 @@ | |||
--- | |||
title: Suspense | |||
description: Using React 18 Suspense features with Apollo Client | |||
description: Use React 18 Suspense features with Apollo Client |
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 matches the tense of the other pages in the Fetching section.
@@ -70,13 +70,21 @@ function Dog({ id }: DogProps) { | |||
} | |||
``` | |||
|
|||
> **Note:** This example manually defines TypeScript interfaces for `Data` and `Variables` as well as the type for `GET_DOG_QUERY` using `TypedDocumentNode`. [GraphQL Code Generator](https://www.the-guild.dev/graphql/codegen) is a popular tool that creates these type definitions automatically for you. See the reference on [Using TypeScript](../development-testing/static-typing) for more information on integrating GraphQL Code Generator with Apollo Client. | |||
<Note> |
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.
Since 3.9 docs introduced the component, I figured we should standardize at least throughout this page.
size-limit report 📦
|
We begin fetching our `GET_DOG_QUERY` by calling the `loadDog` function inside of the `onChange` handler function when a dog is selected. Once the network request is initiated, the `queryRef` is no longer `null` which renders the `Dog` component. In the `Dog` component, `useReadQuery` suspends the component while the network request finishes, then returns `data` to the component. As a result of this change, we've also eliminated the need to track the selected dog `id` in component state! | ||
We begin fetching our `GET_DOG_QUERY` by calling the `loadDog` function inside of the `onChange` handler function when a dog is selected. Once the network request is initiated, the `queryRef` is no longer `null`, rendering the `Dog` component. | ||
|
||
`useReadQuery` suspends the `Dog` component while the network request finishes, then returns `data` to the component. As a result of this change, we've also eliminated the need to track the selected dog `id` in component state. |
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.
Just breaking up a longer paragraph.
|
||
</ExperimentalFeature> | ||
|
||
Starting with Apollo Client `3.9.0`, queries can be initiated outside of React. This allows your app to begin fetching data _before_ React renders your components, and can provide performance benefits. | ||
Starting with Apollo Client `3.9.0`, queries can be initiated outside of React. This allows your app to begin fetching data before React renders your components, and can provide performance benefits. |
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.
Due to feedback from our docs consultants, we're pulling back on text treatment and reserving italics for new terms and bold for UI elements. (See Text formatting in Style guide.)
✅ Deploy Preview for apollo-client-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
Thanks so much for going through this!
And yes, those quoted strings are important to avoid confusion on how to define it. The properties are declared as:
{
"queryManager.getDocumentInfo": 1000
}
Rather than something like:
{
queryManager: {
getDocumentInfo: 1000
}
}
Those quotes help provide a hint at this structure.
Very minor copyedits on 3.9 docs—mostly breaking up long sentences and paragraphs and making things more concise. (Sorry it took me so long to get to them!)
As a side note, I was able to review the Cache Sizes doc earlier, but am just noticing the double quotations on some of the cache options. Is this intended?