Graphql-playground: Body encased in error Object when status Code is 401

Created on 4 Dec 2018  路  3Comments  路  Source: graphql/graphql-playground

This issue pertains to the following package(s):

  • [x ] GraphQL Playground - Electron App
  • [ ] GraphQL Playground HTML
  • [ ] GraphQL Playground
  • [ ] 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?

Mac OS 10.14.1

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

Version 1.8.4

What is the expected behavior?

Show Body as it is returned by the server as

{
  "data": {}
}

What is the actual behavior?

Body shown in error object

{
  "error": {
    data: {}
  }

}

What steps may we take to reproduce the behavior?

Set up a GraphQL server that returns a 401 status code without a graphQL error in the body.

Gif showing the same 200 and 401 responses rendered differently:
graphql-bug

bu2-confirmed kinbug

All 3 comments

Just spent two hours trying to debug ApolloServer error formatting because of this, FML.

(NOTE: it also happens for 400 status codes, e.g. GRAPHQL_VALIDATION_FAILED)

This appears to happen with all non-success status codes. Also, it is happening on the HTML client delivered via CDN.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

marktani picture marktani  路  3Comments

stevecaldwell77 picture stevecaldwell77  路  3Comments

phuongthuan picture phuongthuan  路  3Comments

schickling picture schickling  路  3Comments

deathg0d picture deathg0d  路  3Comments