Skip to content

Introducing some error type to the spec #135

Closed
@arunoda

Description

@arunoda

Right now, when some error happens inside GraphQL schema or in the syntax wise we get errors as whole. Then it's our job to decide what to do with it.

But it would be great, if we can have a set of GraphQL error types(in the spec) which deals with different use cases.

  1. Syntax/Type Errors - These errors are for the errors in client provides query
  2. Runtime Errors - These are the error occurred in runtime specially with syntax errors and network related errors.
  3. User Errors - These are the errors we need to pass to the user.

Right now, in the graphql-js implementation, we get all these errors as one type. But, it'll be useful if we've some mechanism to differentiate them.

So, it would be great GraphQL spec to define these errors. So, the implementations can use them. Also, the people who write GraphQL schemas can use them to define User Errors.


Then, in the transport layers we can check for these three types of errors and do necessary actions.
Is there any plan to have these in spec. If so, I'd like to work on them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions