Open mxmp210 opened 4 years ago
How do you pass the schema into SchemaParser
?
How do you pass the schema into
SchemaParser
?
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.
Absolutely, we will look into this.
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.
This issue is stalled for so long already.
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
My Schema Contains two root functions
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?