Setting "cache-and-network" as default fetch policy
This commit is contained in:
1 parent
f889f6c93c
commit
59669f23e7
1 file changed
+15
@@ -73,8 +73,23 @@ const authLink = setContext((_, { headers }) => {
|
||||
|
||||
const cache = new InMemoryCache().restore(window.__APOLLO_STATE__)
|
||||
|
||||
const defaultOptions = {
|
||||
watchQuery: {
|
||||
fetchPolicy: 'cache-and-network',
|
||||
errorPolicy: 'all'
|
||||
},
|
||||
query: {
|
||||
fetchPolicy: 'cache-and-network',
|
||||
errorPolicy: 'all'
|
||||
},
|
||||
mutate: {
|
||||
errorPolicy: 'all'
|
||||
}
|
||||
}
|
||||
|
||||
export const client = new ApolloClient({
|
||||
link: ApolloLink.from([authRetryLink, authLink, httpLink]), // replaced link with httpLink
|
||||
cache,
|
||||
defaultOptions,
|
||||
connectToDevTools: true
|
||||
})
|
||||
Reference in new issue
Block a user