react-apollo-hooks icon indicating copy to clipboard operation
react-apollo-hooks copied to clipboard

Global `fetchPolicy` has no effect

Open elie222 opened this issue 6 years ago • 0 comments

For example:

import { ApolloClient } from 'apollo-client'

const httpLink = createUploadLink({
  uri: GRAPHQL_URL,
})

const cache = new InMemoryCache()

export const client = new ApolloClient({
  link: ApolloLink.from([httpLink]),
  cache,
  defaultOptions: {
    watchQuery: {
      fetchPolicy: 'cache-and-network'
    },
    query: {
      fetchPolicy: 'cache-and-network'
    }
  }
})

It does work when I set fetchPolicy for specific queries.

elie222 avatar Jul 31 '19 09:07 elie222