Skip to content

Misc get started tweaks and more robust useLazyQuery documentation - #12833

Merged
jerelmiller merged 21 commits into
release-4.0from
jerel/get-started-doc
Aug 8, 2025
Merged

Misc get started tweaks and more robust useLazyQuery documentation#12833
jerelmiller merged 21 commits into
release-4.0from
jerel/get-started-doc

add test

cbe685a
Select commit
Loading
Failed to load commit list.
Apollo Librarian / AI Style Review succeeded Aug 8, 2025 in 1m 19s

Style Review Completed

The pull request has 15 style issues.

Duration: 756ms
PR URL: #12833
Review Comments: The AI has posted 15 inline comments with suggestions

Summary of changes:

The documentation was updated to improve clarity, tone, and formatting. Key changes include using imperative verbs for tutorial headings and instructions, incorporating contractions for a more approachable tone, and ensuring terminal commands longer than three words are in code blocks. Additionally, link text was revised to be more descriptive, and overly casual language was removed to maintain a professional yet encouraging tone.

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

Annotations

Check warning on line 253 in docs/source/data/queries.mdx

See this annotation in the file changed.

@apollo-librarian apollo-librarian / AI Style Review

docs/source/data/queries.mdx#L253

Headings in tutorials should use imperative verbs for instructions.

```suggestion
## Fetch data in response to user interaction
```

Check notice on line 257 in docs/source/data/queries.mdx

See this annotation in the file changed.

@apollo-librarian apollo-librarian / AI Style Review

docs/source/data/queries.mdx#L257

Use contractions like "doesn't" to create a more approachable tone.

```suggestion
The [<code>useLazyQuery</code>](../api/react/useLazyQuery) hook is suited for manually executing queries. Unlike <code>useQuery</code>, when you use <code>useLazyQuery</code>, it doesn't immediately execute its associated query. Instead, it returns an execution function that you call whenever you need to execute the query.
```

Check warning on line 284 in docs/source/data/queries.mdx

See this annotation in the file changed.

@apollo-librarian apollo-librarian / AI Style Review

docs/source/data/queries.mdx#L284

Headings in tutorials should use imperative verbs for instructions.

```suggestion
### Re-render with new options
```

Check notice on line 286 in docs/source/data/queries.mdx

See this annotation in the file changed.

@apollo-librarian apollo-librarian / AI Style Review

docs/source/data/queries.mdx#L286

Use contractions like "don't" to create a more approachable tone.

```suggestion
Unlike <code>useQuery</code>, options provided to <code>useLazyQuery</code> that change on re-renders don't automatically execute the query. Instead, <code>useLazyQuery</code> waits to execute the query using the updated options until the execution function is called again.
```

Check notice on line 309 in docs/source/data/queries.mdx

See this annotation in the file changed.

@apollo-librarian apollo-librarian / AI Style Review

docs/source/data/queries.mdx#L309

Use contractions like "isn't" to create a more approachable tone.

```suggestion
The changed options are immediately applied to the underlying <code>ObservableQuery</code> (accessible by the <code>observable</code> property) even though the query isn't executed. Inspecting the options on the <code>observable</code> returns the updated options. This means the updated options will be used for other APIs (such as <code>refetch</code>), even before calling the execution function again.
```

Check warning on line 313 in docs/source/data/queries.mdx

See this annotation in the file changed.

@apollo-librarian apollo-librarian / AI Style Review

docs/source/data/queries.mdx#L313

Headings in tutorials should use imperative verbs for instructions.

```suggestion
### Work with variables
```

Check notice on line 339 in docs/source/data/queries.mdx

See this annotation in the file changed.

@apollo-librarian apollo-librarian / AI Style Review

docs/source/data/queries.mdx#L339

Use contractions like "isn't" to create a more approachable tone.

```suggestion
When using TypeScript, the <code>variables</code> option is required along with any required variables when the query provided to <code>useLazyQuery</code> contains required variables. If the options argument isn't provided to the execution function, or the <code>variables</code> option is missing required variables, you see a TypeScript error.
```

Check warning on line 343 in docs/source/data/queries.mdx

See this annotation in the file changed.

@apollo-librarian apollo-librarian / AI Style Review

docs/source/data/queries.mdx#L343

Headings in tutorials should use imperative verbs for instructions.

```suggestion
#### Change variables
```

Check warning on line 401 in docs/source/data/queries.mdx

See this annotation in the file changed.

@apollo-librarian apollo-librarian / AI Style Review

docs/source/data/queries.mdx#L401

Headings in tutorials should use imperative verbs for instructions.

```suggestion
### Use the promise from the execution function
```

Check warning on line 454 in docs/source/data/queries.mdx

See this annotation in the file changed.

@apollo-librarian apollo-librarian / AI Style Review

docs/source/data/queries.mdx#L454

Headings in tutorials should use imperative verbs for instructions.

```suggestion
#### Handle errors
```

Check notice on line 456 in docs/source/data/queries.mdx

See this annotation in the file changed.

@apollo-librarian apollo-librarian / AI Style Review

docs/source/data/queries.mdx#L456

Use link text that describes the linked content. The phrase "read the" is unnecessary.

```suggestion
The promise resolves or rejects depending on the configured [<code>errorPolicy</code>](./error-handling#setting-an-error-policy). For a more comprehensive guide, see the [Error handling documentation](./error-handling).
```

Check warning on line 519 in docs/source/data/queries.mdx

See this annotation in the file changed.

@apollo-librarian apollo-librarian / AI Style Review

docs/source/data/queries.mdx#L519

Use the imperative for instructions. The phrase "We recommend" is not as direct as an instruction.

```suggestion
<code>data</code> might be <code>undefined</code> if a [network error](./error-handling#network-errors) occurs. Check if <code>data</code> is <code>undefined</code> before you use it, in case an error occurs during query execution.
```

Check warning on line 523 in docs/source/data/queries.mdx

See this annotation in the file changed.

@apollo-librarian apollo-librarian / AI Style Review

docs/source/data/queries.mdx#L523

Headings in tutorials should use imperative verbs for instructions.

```suggestion
#### Retain query results
```

Check warning on line 29 in docs/source/get-started.mdx

See this annotation in the file changed.

@apollo-librarian apollo-librarian / AI Style Review

docs/source/get-started.mdx#L29

Terminal commands longer than three words must be in a code block.

```suggestion
```bash
npm install @apollo/client graphql rxjs
```
```

Check notice on line 80 in docs/source/get-started.mdx

See this annotation in the file changed.

@apollo-librarian apollo-librarian / AI Style Review

docs/source/get-started.mdx#L80

Avoid exaggerated or overly casual words like "Nice!". The tone should be encouraging but professional.

```suggestion
Run this code, open your console, and inspect the result object. You should see a <code>data</code> property with <code>locations</code> attached.
```