-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
Description
I am currently using nextJS with apollo and it's completely unusable for me because the cookie is not passing in every request.
I would be much grateful if someone can just point me to right direction to pass cookies properly.
Even the apollo nextjs example is buggy itself https://github.com/adamsoffer/next-apollo-example
Even in that example, cookies are not being sent in the request.
I am trying every possible way of setting cookies in config without success.
Some people say swapping ApolloClient to ApolloBoost have solved it but neither of the packages work for me.
Below is an example of what I have tried
new ApolloClient({
connectToDevTools: process.browser,
ssrMode: !process.browser, // Disables forceFetch on the server (so queries are only run once)
link: new HttpLink({
uri: APOLLO_ENDPOINT, // Server URL (must be absolute)
opts:{
credentials:'include'
},
credentials: 'include', // Additional fetch() options like `credentials` or `headers`,
}),
cache: new InMemoryCache().restore(initialState || {}),
fetchOptions:{
credentials:'include'
},
credentials:'include'
})
antenando, techyrajeev, jondpenton, jakeadelman, jaabiri and 38 moreavinoamsn