SG
const tokenVar = makeVar()
const client = new ApolloClient({
...
link: setContext((_, { headers }) => ({
headers: {
...headers,
authorization: `Bearer ${tokenVar()}`
}
}))
})
...
const authenticate = async (login: string, password: string) => {
const token = await client.mutate(...)
tokenVar(token)
await client.query(MeQuery, { fetchPolicy: 'network-only' })
}



