0 votes
in GraphQL by
How to do Error Handling in GraphQL?

1 Answer

0 votes
by

It is easy to see the error in GraphQL. A successful GraphQL query is supposed to return a JSON object with a root field called "data." If your request query fails or partially fails, you will see a second root field called "errors" in the response. See the below example

AD

Example:

{  

  "data": { ... },  

  "errors": [ ... ]  

}   

Note: Sometimes, the request query fails or partially fails if the user requesting the data doesn't have the right access permission.

...