How to do Error Handling?

Technology CommunityCategory: GraphQLHow to do Error Handling?
VietMX Staff asked 3 years ago

A successful GraphQL query is supposed to return a JSON object with a root field called "data". If the request fails or partially fails (e.g. because the user requesting the data doesn’t have the right access permissions), a second root field called "errors" is added to the response:

    {
      "data": { ... },
      "errors": [ ... ]
    }