We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0e9a4b4 commit 231621dCopy full SHA for 231621d
plugins/apollo.js
@@ -57,12 +57,29 @@ export default defineNuxtPlugin((nuxtApp) => {
57
);
58
59
// Cache implementation
60
- const cache = new InMemoryCache();
+ const cache = new InMemoryCache({
61
+ typePolicies: {
62
+ Query: {
63
+ fields: {
64
+ cart: {
65
+ merge(existing, incoming) {
66
+ return incoming;
67
+ },
68
69
70
71
72
+ });
73
74
// Create the apollo client
75
const apolloClient = new ApolloClient({
76
link: middleware.concat(afterware.concat(httpLink)),
77
cache,
78
+ defaultOptions: {
79
+ watchQuery: {
80
+ fetchPolicy: 'cache-and-network',
81
82
83
});
84
85
provideApolloClient(apolloClient);
0 commit comments