Skip to content

Commit

Permalink
Fix Apollo caching for MessageEvents
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas FitzRoy-Dale committed Apr 18, 2024
1 parent 25576e5 commit 79abf0c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion frontend/src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,17 @@ const wsLink = new GraphQLWsLink(createClient({
url: backendUrl + '/graphql-ws',
}));

const apolloCache = new InMemoryCache({
typePolicies: {
MessageEvent: {
keyFields: ['id', 'deviceId', 'providerName'],
},
}
});

export const apolloClient = new ApolloClient({
link: wsLink,
cache: new InMemoryCache(),
cache: apolloCache,
});

provideApolloClient(apolloClient);
Expand Down

0 comments on commit 79abf0c

Please sign in to comment.