Skip to content

Commit

Permalink
Update phrasing/position
Browse files Browse the repository at this point in the history
  • Loading branch information
nopelluhh committed Nov 13, 2023
1 parent a12cdaf commit 441b135
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/source/data/mutations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ const [addTodo, { data, loading, error }] = useMutation(ADD_TODO, {
});
```

> You can only refetch _active_ queries. Active queries are those used by components on the current page. If the data you want to update is not fetched by a component on the current page, it's best to [update your cache directly](#updating-the-cache-directly).
Each element in the `refetchQueries` array is one of the following:

* A `DocumentNode` object parsed with the `gql` function
Expand All @@ -223,8 +225,6 @@ You can provide the `refetchQueries` option either to `useMutation` or to the mu

Note that in an app with tens or hundreds of different queries, it can be challenging to determine exactly which queries to refetch after a particular mutation.

> Only active queries can be refetched using this option. If the query you want to refetch is not used by a component on the current page, you may want to consider modifying your mutation to support updating the cache directly as described below.
## Updating the cache directly

### Include modified objects in mutation responses
Expand Down

0 comments on commit 441b135

Please sign in to comment.