'Identifying the location of errors in a GraphQL Schema

How do you get the line number location of syntax errors using GraphQL library?

If you use the buildSchema function in the library, this will throw an exception with an error message explaining the error but there is no location.

If you use the parse function, you get a Document which contains all the symbols and their line numbers, but no error information.

Is there another function that will return all the errors and their locations in the schema?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source