I can set cookie in client, but I don't know how to get cookies from server reslover (apollo graphql.)
// resolver.js
export const resolvers = {
Query: {
async getSinglePost(_, args, context) {
// "context.req.headers.cookies" are empty. d
// Even if setting "credentials: 'include' " in creating Apollo client chche.
},
},
// apolloClient.js
new ApolloClient({
ssrMode: Boolean(ctx),
link: authLink.concat(new HttpLink({
uri: 'http://localhost:4000/graphql', // Server URL (must be absolute)
credentials: 'same-origin', // Additional fetch() options like `credentials` or `headers`
fetch,
})),
cache: new InMemoryCache({ fragmentMatcher }).restore(initialState),
credentials: 'include',
})
Am I miss something?