Errors
Theerrors
entry in the response is a non‐empty list of errors, where each error is a map.
If no errors were encountered during the requested operation, theerrors
entry should not be present in the result.
Every error must contain an entry with the keymessage
with a string description of the error intended for the developer as a guide to understand and correct the error.
If an error can be associated to a particular point in the requested GraphQL document, it should contain an entry with the keylocations
with a list of locations, where each location is a map with the keysline
andcolumn
, both positive numbers starting from1
which describe the beginning of an associated syntax element.
GraphQL servers may provide additional entries to error as they choose to produce more helpful or machine‐readable errors, however future versions of the spec may describe additional entries to errors.
If thedata
entry in the response isnull
or not present, theerrors
entry in the response must not be empty. It must contain at least one error. The errors it contains should indicate why no data was able to be returned.
If thedata
entry in the response is notnull
, theerrors
entry in the response may contain any errors that occurred during execution. If errors occurred during execution, it should contain those errors.