add cache redirects for the items query

This commit is contained in:
Matt Dunn-Rankin 2020-04-22 16:18:29 -07:00
parent 5074b17aba
commit 8e8eea2b39

View file

@ -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() {