diff --git a/src/app/apolloClient.js b/src/app/apolloClient.js index 37af783..0f4e7d0 100644 --- a/src/app/apolloClient.js +++ b/src/app/apolloClient.js @@ -35,7 +35,6 @@ const httpLink = createHttpLink({ uri: "/api/graphql" }); * queries. This is how we communicate with the server! */ export default new ApolloClient({ - cacheRedirects, link: persistedQueryLink.concat(httpLink), - cache: new InMemoryCache(), + cache: new InMemoryCache({ cacheRedirects }), }); diff --git a/src/app/useOutfitState.js b/src/app/useOutfitState.js index 25554b5..c71ebd6 100644 --- a/src/app/useOutfitState.js +++ b/src/app/useOutfitState.js @@ -124,7 +124,13 @@ const outfitStateReducer = (apolloClient) => (baseState, action) => { // doing a search and it loads before the worn item data does? Anyway, // Apollo will throw in that case, which should just essentially reject // the action.) - const conflictingIds = findItemConflicts(itemId, state, apolloClient); + let conflictingIds; + try { + conflictingIds = findItemConflicts(itemId, state, apolloClient); + } catch (e) { + console.error(e); + return; + } for (const conflictingId of conflictingIds) { wornItemIds.delete(conflictingId); closetedItemIds.add(conflictingId);