import ApolloClient from 'apollo-boost'
const client = new ApolloClient({
request: (operation) => {
const token = localStorage.getItem('token')
operation.setContext({
headers: {
authorization: token ? `Bearer ${token}` : ''
}
})
}
})
import ApolloClient from 'apollo-boost';
const client = new ApolloClient({
cacheRedirects: {
Query: {
dog: (_, { id }, { getCacheKey }) => getCacheKey({ id, __typename: 'Dog' })
}
}
})
import ApolloClient from 'apollo-boost';
const client = new ApolloClient({
uri: 'https://48p1r2roz4.sse.codesandbox.io',
});
import ApolloClient from "apollo-boost";
const client = new ApolloClient({
uri: "https://w5xlvm3vzz.lp.gql.zone/graphql"
});
import ApolloClient from 'apollo-boost';
// the Apollo cache is set up automatically
const client = new ApolloClient();