Closed EthanSK closed 4 years ago
I'm seeing this too with the graphql-playground-middleware-express. It looks it may be a problem with prettier.
Same problem here. In my case I had this error:
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
This issue pertains to the following package(s):
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