add cache redirects for the items query
This commit is contained in:
parent
5074b17aba
commit
8e8eea2b39
1 changed files with 6 additions and 0 deletions
|
@ -7,6 +7,12 @@ import ApolloClient from "apollo-boost";
|
|||
|
||||
const client = new ApolloClient({
|
||||
uri: "/api/graphql",
|
||||
cacheRedirects: {
|
||||
Query: {
|
||||
items: (_, args, { getCacheKey }) =>
|
||||
args.ids.map((id) => getCacheKey({ __typename: "Item", id })),
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
function App() {
|
||||
|
|
Loading…
Reference in a new issue