Jak zwykle w dokumentacji nie ma nic na ten temat tylko trzeba przeszukać pół internetu może komuś się kiedyś przyda:
import { HttpLink } from 'apollo-link-http' import { setContext } from 'apollo-link-context' import { from } from 'apollo-link' import { InMemoryCache } from 'apollo-cache-inmemory'
Jak zwykle w dokumentacji nie ma nic na ten temat tylko trzeba przeszukać pół internetu może komuś się kiedyś przyda:
import { HttpLink } from 'apollo-link-http'
import { setContext } from 'apollo-link-context'
import { from } from 'apollo-link'
import { InMemoryCache } from 'apollo-cache-inmemory'
export default ({ app, store }) => {
const { baseGQL } = app.context.env
const headersConfig = setContext(() => ({
headers: {
'x-xsrf-token': app.$cookies.get('XSRF-TOKEN'),
},
credentials: 'include',
}))
const httpLink = new HttpLink({
uri: baseGQL,
})
const link = from([headersConfig, httpLink])
const cache = new InMemoryCache()
return {
link,
cache,
defaultHttpLink: false,
}
}
i też #vue w sumie
Komentarz usunięty przez autora