You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can return or throw an error from a resolver. I don’t know exactly how GitHub is adding the "type" field to their errors but you can do something similar by using GraphQL’s built-in error class to create an error with some extra information in the response.
For example:
// From your resolver...returnnewGraphQLError("Person not found",{extensions: {type: "NOT_FOUND"}});
Hi,
I have a custom resolver (like https://github.com/miragejs/graphql?tab=readme-ov-file#example-deleting-a-person). For a minimal example, consider that the database table
person
is empty and the result ofis
person
be null. How do I create a NOT_FOUND error? Currently, Mirage JS GraphQL will returnnull
but no error.I would appreciate any help to reproduce the follow query to GitHub GraphQL API
The text was updated successfully, but these errors were encountered: