Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: trace preview on schema errors #1202

Merged
merged 15 commits into from
Jul 10, 2020
Merged

feat: trace preview on schema errors #1202

merged 15 commits into from
Jul 10, 2020

Conversation

Weakky
Copy link
Collaborator

@Weakky Weakky commented Jul 9, 2020

Description

  • better schema.* related errors (printed stack trace)
  • graphql highlighted errors
  • normalized errors between graphql and schema.*
  • disabled timeDiff logger

Preview

GraphQL:
image

schema.*:
image

TODO

  • docs
    • jsdoc
    • website api
    • website guides
    • website tutorial
  • tests

@Weakky
Copy link
Collaborator Author

Weakky commented Jul 9, 2020

Wanted to do some testing on the logPrettyError function but snapshotting the stack trace and all these paths is not working well, even with the normalizePathsInData helper. How bad is it if we start without snapshots which won't help us much I think anyway?

@Weakky Weakky requested a review from jasonkuhrt July 9, 2020 15:30
Copy link
Member

@jasonkuhrt jasonkuhrt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

Comment on lines 135 to 138
/**
* Validate the GraphQL schema
*/
GraphQL.validate(schema, GraphQL.parse(GraphQL.introspectionQuery))
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm frankly not sure about this line that I've just added. What I've realized is that we have some cases , such as a type without any field, that aren't caught as a bug. However, when running the server, the playground sends an introspection query, which ends up throwing an unexpected error a couple of seconds later. This line here, tries to validate the schema against an introspection query to validate this class of error. WDYT?

@Weakky Weakky merged commit 13d847a into master Jul 10, 2020
@Weakky Weakky deleted the feat/better-error branch July 10, 2020 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants