React Apollo – Make Multiple Queries

My preferred way is to use the compose functionality of the apollo client (docu). EDIT: If you have more than one query you should name them. So in your case, it could look like this: import React, {Component} from ‘react’ import queries from ‘./queries’ import { graphql, compose } from ‘react-apollo’; class Test extends Component … Read more

How to disable cache in apollo-link or apollo-client?

You can set defaultOptions to your client like this: const defaultOptions: DefaultOptions = { watchQuery: { fetchPolicy: ‘no-cache’, errorPolicy: ‘ignore’, }, query: { fetchPolicy: ‘no-cache’, errorPolicy: ‘all’, }, } const client = new ApolloClient({ link: concat(authMiddleware, httpLink), cache: new InMemoryCache(), defaultOptions: defaultOptions, }); fetchPolicy as no-cache avoids using the cache. See https://www.apollographql.com/docs/react/api/core/ApolloClient/#defaultoptions