In the last article of the series on how to create a GraphQL server with TypeScript and
Fortunately, the ApolloServerConfig has the property playground that can be something else than a boolean. It can be a ISettings. The interface has a “request.credentials” and by default “omit”. Changing the default to “same-origin” will carry the missing headers.
playground: { settings: { "general.betaUpdates": false, "editor.theme": "dark", "editor.reuseHeaders": true, "tracing.hideTracingResponse": false, "editor.fontSize": 14, "editor.fontFamily": "'Source Code Pro', 'Consolas', 'Inconsolata', 'Droid Sans Mono', 'Monaco', monospace", "request.credentials": "same-origin" } }
I had to specify additional configuration because the TypeScript definition type has all the field required, so I copy pasted the default value I found under the gear icon in the playground.

Summary
In this
My Other GraphQL Articles
- Getting Started with GraphQL for Netflix Open Connect
- Install Apollo Server to host a GraphQL service
- Apollo Server and Secured Playground
- GraphQL Context
- GraphQL Query with Argument
- Apollo GraphQL Resolvers and Data Source separation
- How to setup a TypeScript, NodeJS, Express Apollo Server to easy debugging with VsCode
- GraphQL Resolvers with Apollo
- Configuring Apollo Playground and API on two different URL
- How to automatically generate TypeScript for consumers of your GraphQL