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
I was trying to implement Relay / Connection example, accidentally I made a mistake in schema file and console was giving parsing errors.
It looked something like this :
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [graphql.kickstart.tools.SchemaParser]: Factory method 'schemaParser' threw exception; nested exception is graphql.parser.InvalidSyntaxException: Invalid Syntax : offending token '(' at line 9 column 17
While the error was on line 2, column 19 for not having space between argument and type, it was impossible to identify where the problem persisted because of not readable error outputs.
I know this is an old issue and needs reworks, and documentation assumes many things that user would know before starting, Is there any way to format errors at-least right so that it can be helpful?
It is picked up by graphql-kickstart from .graphqls files in resources.
I managed to find error in schema, it's not the problem, the problem is, if the schema is having minor errors like having spaces or typing mistake, line number would be completely different, making it almost impossible to find from looking at error code.
Just had this error in a project. The problem is that the SchemaParser interprets all .graphqls files as a single file, that way, the column that is pointed is precise, but not the line, as it counts all the lines from other files parsed before, e.g., the line in which the error occurs is the line from the file plus an offset of all the lines already parsed from previous .graphql files.
Just had this error in a project. The problem is that the SchemaParser interprets all .graphqls files as a single file, that way, the column that is pointed is precise, but not the line, as it counts all the lines from other files parsed before, e.g., the line in which the error occurs is the line from the file plus an offset of all the lines already parsed from previous .graphql files.
Agreed, although whole point of stack trace is to get back to origin. Giving lines in internal in memory file would be misleading as complex schemas would contain multiple files and tracing them would be very hard from given information.
Activity
vojtapol commentedon Apr 14, 2020
How do you pass the schema into
SchemaParser?mxmp210 commentedon Apr 17, 2020
It is picked up by graphql-kickstart from .graphqls files in resources.
I managed to find error in schema, it's not the problem, the problem is, if the schema is having minor errors like having spaces or typing mistake, line number would be completely different, making it almost impossible to find from looking at error code.
vojtapol commentedon Apr 17, 2020
Absolutely, we will look into this.
Raf98 commentedon Jan 12, 2022
Just had this error in a project. The problem is that the SchemaParser interprets all .graphqls files as a single file, that way, the column that is pointed is precise, but not the line, as it counts all the lines from other files parsed before, e.g., the line in which the error occurs is the line from the file plus an offset of all the lines already parsed from previous .graphql files.
mxmp210 commentedon Jan 22, 2022
Agreed, although whole point of stack trace is to get back to origin. Giving lines in internal in memory file would be misleading as complex schemas would contain multiple files and tracing them would be very hard from given information.
This issue is stalled for so long already.