question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Better error handling for invalid schemas

See original GitHub issue

Not sure if this is an issue with graphql-let or @graphql-codegen, but if you have an error with your schema, the only error message is [ graphql-let ] Failed to load schema. Is there a way a more detailed error that could be exposed? (eg line number of the error)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
marklawlorcommented, May 21, 2020

Running v0.10.0

My invalid schema.d.ts

type Query {
  test: string
}

graphql-let gives me the error:

[ graphql-let ] Failed to load schemaError: Failed to load schema

Testing with other GraphQL tools (ApolloServer and graphql-tag) both give the error

Error: Unknown type "string". Did you mean "String"?

While developing with graphql-let I’m finding myself constantly copying my schema into other tools just to get a more meaningful error message. It would be extremely useful if graphql-let had similar error messages.

1reaction
marklawlorcommented, Jul 11, 2020

@piglovesyou The use case I specified above is not solved with version v0.11.1, I still receive the exact same output when graphql-let is loading my schema. I believe @salzhrani PR only handles GraphQL errors during the .d.ts generation, but the error I’m getting is in the initial schema load.

But I am getting much better error messages for my documents 🥳

Read more comments on GitHub >

github_iconTop Results From Across the Web

Handling Validation Errors - python-jsonschema
When an invalid instance is encountered, a ValidationError will be raised or returned, depending on which method or function is used. In case...
Read more >
Schema Validation and Error Handling - Sample Use Cases
This sample demonstrates the schema validation and error handling capabilities ... The configuration specifies a service level error handler and the invalid ......
Read more >
Error handling - Apollo GraphQL Docs
The GraphQL operation is not valid against the server's schema. BAD_USER_INPUT. The GraphQL operation includes an invalid value for a field argument.
Read more >
Understanding schema errors | HESA
1) Invalid values. In these examples the error message states that the value returned is invalid. · 2) Invalid child elements · 3)...
Read more >
8.7.2 Validating (Compiling) Invalid Schema Objects
Schema objects (such as triggers, procedures, or views) might be invalidated when changes are made to objects on which they depend. For example,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found