0
Follow
0
View

HTTP Cookie not being set with Nestjs

dghlpan 注册会员
2023-01-25 17:01

The GQL playground by default doesn't send credentials. In the options of the GQL playground, set request.credentials = 'include' and it should work

dazui9813 注册会员
2023-01-25 17:01

Maybe a little late, but here is a code example for NestJS users:

const GraphQL = GraphQLModule.forRoot({
  driver: ApolloDriver,
  playground: {
    settings: {
      "request.credentials": "include", // Otherwise cookies won't be sent
    }
  },
  // ...
});