Graphql-playground: Schema tab not working

Created on 22 Jun 2020  路  4Comments  路  Source: graphql/graphql-playground

This issue pertains to the following package(s):

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

MacOS

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

1.7.23 , latest

What is the expected behavior?

Schema tab shows blank screen

What is the actual behavior?

It should show the schema

Most helpful comment

Same problem here. In my case I had this error:
image

I think it may be linked to this issue: https://github.com/prisma-labs/graphql-playground/issues/1115

A workaround is to set schema.disableComments to false in the playground settings (cog in the top-right hand corner).

All 4 comments

I'm seeing this too with the graphql-playground-middleware-express. It looks it may be a problem with prettier.
Screen Shot 2020-06-22 at 9 55 43 AM

Same problem here. In my case I had this error:
image

I think it may be linked to this issue: https://github.com/prisma-labs/graphql-playground/issues/1115

A workaround is to set schema.disableComments to false in the playground settings (cog in the top-right hand corner).

I'm also seeing this behavior, and the workaround @joffrey-bion mentions fixes it for me.

Here's the syntax error it's throwing:

Uncaught SyntaxError: Syntax Error: Unexpected Name "now" (5:3)
  3 | 
  4 |   
> 5 |   now: DateTime
    |   ^
  6 | 
  7 |   
  8 |   me: User!
    at n (parser-graphql.js:1)
    at Object.parse (parser-graphql.js:1)
    at Object.parse (standalone.js:13721)
    at coreFormat (standalone.js:17145)
    at format (standalone.js:17381)
    at formatWithCursor (standalone.js:17397)
    at standalone.js:32917
    at Object.format (standalone.js:32926)
    at Object.prettify (utils.js:184)
    at Object.getSDL (createSDL.js:105)

Here's the part of my schema that is failing inside prettier-graphql.js:

#
directive @cacheControl(
  maxAge: Int
  scope: CacheControlScope
) on FIELD_DEFINITION | OBJECT | INTERFACE
#
type Query {
  # Retrieve the current server time in UTC.
  now: DateTime
}

dupe, fixed in last release

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Deepaknathtiwari picture Deepaknathtiwari  路  11Comments

anodynos picture anodynos  路  19Comments

barbosa picture barbosa  路  12Comments

schickling picture schickling  路  52Comments

lastmjs picture lastmjs  路  19Comments