Skip to content

Commit

Permalink
Fix some broken links
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Barlow committed Mar 22, 2021
1 parent a8ec20c commit 120b108
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions docs/source/api/cache/InMemoryCache.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ readQuery<QueryType, TVariables = any>(

Writes data to the cache in the shape of a provided GraphQL query. Returns a `Reference` to the written object or `undefined` if the write failed.

For usage instructions, see [Interacting with cached data: `writeQuery`](../../caching/cache-interaction/#writequery-and-writefragment).
For usage instructions, see [Interacting with cached data: `writeQuery`](../../caching/cache-interaction/#writequery).

Takes an `options` object as a parameter. Supported fields of this object are described below.

Expand Down Expand Up @@ -398,7 +398,7 @@ readFragment<FragmentType, TVariables = any>(

Writes data to the cache in the shape of the provided GraphQL fragment. Returns a `Reference` to the written object or `undefined` if the write failed.

For usage instructions, see [Interacting with cached data: `writeFragment`](../../caching/cache-interaction/#writequery-and-writefragment).
For usage instructions, see [Interacting with cached data: `writeFragment`](../../caching/cache-interaction/#writefragment).

Takes an `options` object as a parameter. Supported fields of this object are described below.

Expand Down Expand Up @@ -567,7 +567,7 @@ Modifies one or more field values of a cached object. Must provide a **modifier

Returns `true` if the cache was modified successfully and `false` otherwise.

For usage instructions, see [`cache.modify`](../../caching/cache-interaction/#cachemodify).
For usage instructions, see [Using `cache.modify`](../../caching/cache-interaction/#using-cachemodify).

Takes an `options` object as a parameter. Supported fields of this object are described below.

Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/react/hoc.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,7 @@ This option allows you to update your store based on your mutation’s result. B

`options.update` takes two arguments. The first is an instance of a `DataProxy` object which has some methods which will allow you to interact with the data in your store. The second is the response from your mutation - either the optimistic response, or the actual response returned by your server (see the mutation result described in the [mutation render prop](./components/#render-prop-function-1) section for more details).

In order to change the data in your store call methods on your `DataProxy` instance like [`writeQuery` and `writeFragment`](../../caching/cache-interaction/#writequery-and-writefragment). This will update your cache and reactively re-render any of your GraphQL components which are querying affected data.
In order to change the data in your store call methods on your `DataProxy` instance like [`writeQuery`](../../caching/cache-interaction/#writequery) and [`writeFragment`](../../caching/cache-interaction/#writefragment). This will update your cache and reactively re-render any of your GraphQL components which are querying affected data.

To read the data from the store that you are changing, make sure to use methods on your `DataProxy` like [`readQuery`](../../caching/cache-interaction/#readquery) and [`readFragment`](../../caching/cache-interaction/#readfragment).

Expand Down
4 changes: 2 additions & 2 deletions docs/source/caching/cache-interaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ If your cache contains data for _all_ of the query's fields, `readQuery` returns
}
```

**Do not modify this object directly.** The same object might be returned to multiple components. To update data in the cache, instead create a replacement object and pass it to [`writeQuery`](#writequery-and-writefragment).
**Do not modify this object directly.** The same object might be returned to multiple components. To update data in the cache, instead create a replacement object and pass it to [`writeQuery`](#writequery).

If the cache is missing data for _any_ of the query's fields, `readQuery` returns `null`. It does _not_ attempt to fetch data from your GraphQL server.

Expand Down Expand Up @@ -448,7 +448,7 @@ const invisibleManBook = {
};
```

If we want to interact with this object in our cache with methods like [`writeFragment`](#writequery-and-writefragment) or [`cache.modify`](#cachemodify), we need the object's identifier. Our `Book` type's identifier appears to be custom, because the `id` field isn't present.
If we want to interact with this object in our cache with methods like [`writeFragment`](#writefragment) or [`cache.modify`](#using-cachemodify), we need the object's identifier. Our `Book` type's identifier appears to be custom, because the `id` field isn't present.

Instead of needing to look up that our `Book` type uses the `isbn` field as its identifier, we can use the `cache.identify` method, like so:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ As in the earlier `useQuery` example, whenever the `cartItemsVar` variable is up
Storing local state directly in the Apollo Client cache provides some advantages, but usually requires more code than [using reactive variables](#storing-local-state-in-reactive-variables):

* You don't _have_ to [define a field policy](#defining) for local-only fields that are present in the cache. If you query a field that doesn't define a `read` function, by default Apollo Client attempts to fetch that field's value directly from the cache.
* When you modify a cached field with [`writeQuery` or `writeFragment`](../caching/cache-interaction#writequery-and-writefragment), **every active query that includes the field automatically refreshes**.
* When you modify a cached field with [`writeQuery`](../caching/cache-interaction#writequery) or [`writeFragment`](../caching/cache-interaction#writefragment), **every active query that includes the field automatically refreshes**.

#### Example

Expand All @@ -242,7 +242,7 @@ const IS_LOGGED_IN = gql`
`;
```

The `isLoggedIn` field of this query is a local-only field. We can use [the `writeQuery` method](../caching/cache-interaction/#writequery-and-writefragment) to write a value for this field directly to the Apollo Client cache, like so:
The `isLoggedIn` field of this query is a local-only field. We can use [the `writeQuery` method](../caching/cache-interaction/#writequery) to write a value for this field directly to the Apollo Client cache, like so:

```js
cache.writeQuery({
Expand Down

0 comments on commit 120b108

Please sign in to comment.