Skip to content
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

[pull] main from apollographql:main #195

Merged
merged 1 commit into from
Jun 15, 2022
Merged
Changes from all 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
6 changes: 2 additions & 4 deletions docs/source/caching/cache-configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,7 @@ Each key in the object is the `__typename` of a type to customize, and the corre
</td>
<td>

**Deprecated.** A function that takes a response object and returns a unique identifier to be used when normalizing the data in the store.

Deprecated in favor of the `keyFields` option of the [`TypePolicy` object](#typepolicy-fields).
A function that takes a response object and returns a unique identifier to be used when normalizing the data in the store.

</td>
</tr>
Expand Down Expand Up @@ -208,7 +206,7 @@ const cache = new InMemoryCache({
});
```

> The `dataIdFromObject` API is included in Apollo Client 3 to ease the transition from Apollo Client 2.x. The API might be removed in a future version of `@apollo/client`.
> The `dataIdFromObject` API is included in Apollo Client 3 to ease the transition from Apollo Client 2.x.

Notice that the above function still uses different logic to generate keys based on an object's `__typename`. In a case like this, you should almost always define `keyFields` arrays for the `Product` and `Person` types via `typePolicies`.

Expand Down