Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/source/migrating/apollo-client-4-migration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -997,6 +997,8 @@

A query is in standby if it is skipped with the `skip` option or `skipToken` in a React hook, or if the `fetchPolicy` is set to `standby`.

Although both `skip` and `skipToken` put a query in standby, `client.refetchQueries({ include: [QUERY] })` handles them differently before the first execution. Queries created with `skip: true` can still be refetched because Apollo Client already has their options, including any variables. Queries created with `skipToken` are excluded until after their first execution because Apollo Client doesn't know which variables to use yet. This behavior was introduced in v4.0.11.

Check notice on line 1000 in docs/source/migrating/apollo-client-4-migration.mdx

View check run for this annotation

Apollo Librarian / AI Style Review

docs/source/migrating/apollo-client-4-migration.mdx#L1000

**Framing**: Use reader-centric language ('Queries you create') and avoid passive voice ('Apollo introduced' instead of 'This behavior was introduced'). **Language**: Avoid the idiom 'in standby' to ensure clarity for non-native speakers, and use 'does not' for a more formal tone if desired, though the primary issue is the idiomatic expression. **Verb Tense and Voice**: Use present tense instead of past tense for describing version behavior. **Voice**: The original text is unopinionated. Use authoritative language to prescribe the use of skipToken for this specific scenario. ```suggestion Although both `skip` and `skipToken` put a query in standby, `client.refetchQueries({ include: [QUERY] })` handles them differently before the first execution. Queries you create with `skip: true` can still be refetched because Apollo Client already has their options, including any variables. Queries you create with `skipToken` are excluded until after their first execution because Apollo Client doesn't know which variables to use yet. Apollo introduced this behavior in v4.0.11. ```
Comment thread
phryneas marked this conversation as resolved.
Outdated

</Note>

This change affects the queries returned by `client.getObservableQueries` or the queries fetched by `refetchQueries` when using the `"active"` or `"all"` keywords, as these no longer include `ObservableQuery` instances without subscribers.
Expand Down