Graphql-playground: Tabs headers are ignored

Created on 18 Dec 2018  路  1Comment  路  Source: graphql/graphql-playground

This issue pertains to the following package(s):

  • [ ] GraphQL Playground - Electron App
  • [ ] GraphQL Playground HTML
  • [x] GraphQL Playground React
  • [ ] GraphQL Playground Express Middleware
  • [ ] GraphQL Playground Hapi Middleware
  • [ ] GraphQL Playground Koa Middleware
  • [ ] GraphQL Playground Lambda Middleware

What OS and OS version are you experiencing the issue(s) on?

Web Browser

What version of graphql-playground(-electron/-middleware) are you experiencing the issue(s) on?

1.7.8, 1.7.9, 1.7.10, 1.7.11
It works ok on 1.7.4

What is the expected behavior?

The headers configuration is honored on version 1.7.4 but not on any version >= 1.7.8.

GraphQLPlayground.init(root, {
  "endpoint": "/graphql",
  "subscriptionEndpoint": "/graphql",
  "settings": {
    "general.betaUpdates": false,
    "editor.theme": "light",
    "editor.cursorShape": "block",
    "editor.reuseHeaders": true,
    "tracing.hideTracingResponse": true,
    "editor.fontSize": 14,
    "editor.fontFamily": "'Source Code Pro', 'Consolas', 'Inconsolata', 'Droid Sans Mono', 'Monaco', monospace",
    "request.credentials": "include"
  },
  "tabs": [
    {
      "endpoint": "/api/graphql",
      "headers": {
        "Authorization": "Token cc3dfa5c71101e47a713f8ce896e434f"
      }
    }
  ],
  "canSaveConfig": false
})

What is the actual behavior?

Every settings value is respected; even every tab endpoint. But headers are completely ignored.

What steps may we take to reproduce the behavior?

Setup Apollo Server with the Playground enabled as explained here and try to configure the tabs headers.

_Please provide a gif or image of the issue for a quicker response/fix._

v 1 7 4
v 1 7 11

bu2-confirmed kinbug

Most helpful comment

Same here. I noticed that this only happens when settings/request.credentials parameter is set to include or same-origin, when it's set to omit the headers are included as they should.

>All comments

Same here. I noticed that this only happens when settings/request.credentials parameter is set to include or same-origin, when it's set to omit the headers are included as they should.

Was this page helpful?
0 / 5 - 0 ratings