You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If to comment it out everything works fine, but comments are preserved. So I think there is a problem in regexp which does the jom. Actually, because I have empty-line comment it also removes the next line, so schema code looks like this:
type Query {
id: ID!
): Node
}
which is definitely broken schema.
I use apollo-graphql-express as Apollo server, so it can be fixed by forcing "schema.disableComments": false from server side to make sure initial load will not cause a problem, but if user change this property locally - bug happen! Of course, I can fix it by removing new lines from comments, BTW, despite this fact there is a buggy software behavior...
Server is based on code-first schema generation, so the javascript schema is provided to server instance instead of typeDefs and resolvers. So schema code is built on playground side itself (guess with printSchema...)
This also causes the need to restart electron app, as there is no way to get back or close the blank scree after pressing "Schema" button.
The text was updated successfully, but these errors were encountered:
This issue pertains to the following package(s):
What OS and OS version are you experiencing the issue(s) on?
Linux
What version of graphql-playground(-electron/-middleware) are you experiencing the issue(s) on?
1.7.31 and from master branch
What is the expected behavior?
Schema view displays schema
What is the actual behavior?
Empty screen, Syntax error in web browser console
What steps may we take to reproduce the behavior?
Have a schema with comments like this
I found, that problem is caused by this line of code in
packages/graphql-playground-react/src/components/Playground/util/createSDL.ts
at line92
:If to comment it out everything works fine, but comments are preserved. So I think there is a problem in regexp which does the jom. Actually, because I have empty-line comment it also removes the next line, so schema code looks like this:
which is definitely broken schema.
I use apollo-graphql-express as Apollo server, so it can be fixed by forcing
"schema.disableComments": false
from server side to make sure initial load will not cause a problem, but if user change this property locally - bug happen! Of course, I can fix it by removing new lines from comments, BTW, despite this fact there is a buggy software behavior...Server is based on code-first schema generation, so the javascript schema is provided to server instance instead of
typeDefs
andresolvers
. So schema code is built on playground side itself (guess with printSchema...)This also causes the need to restart electron app, as there is no way to get back or close the blank scree after pressing "Schema" button.
The text was updated successfully, but these errors were encountered: