File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -22,9 +22,31 @@ export function formatError(error: GraphQLError): GraphQLFormattedError {
22
22
: { message, locations, path } ;
23
23
}
24
24
25
+ /**
26
+ * @see https://github.com/graphql/graphql-spec/blob/master/spec/Section%207%20--%20Response.md#errors
27
+ */
25
28
export type GraphQLFormattedError = { |
29
+ /**
30
+ * A short, human-readable summary of the problem that **SHOULD NOT** change
31
+ * from occurrence to occurrence of the problem, except for purposes of
32
+ * localization.
33
+ */
26
34
+ message : string ,
35
+ /**
36
+ * If an error can be associated to a particular point in the requested
37
+ * GraphQL document, it should contain a list of locations.
38
+ */
27
39
+ locations : $ReadOnlyArray < SourceLocation > | void ,
40
+ /**
41
+ * If an error can be associated to a particular field in the GraphQL result,
42
+ * it _must_ contain an entry with the key `path` that details the path of
43
+ * the response field which experienced the error. This allows clients to
44
+ * identify whether a null result is intentional or caused by a runtime error.
45
+ */
28
46
+ path : $ReadOnlyArray < string | number > | void ,
47
+ /**
48
+ * Reserved for implementors to extend the protocol however they see fit,
49
+ * and hence there are no additional restrictions on its contents.
50
+ */
29
51
+ extensions ?: { [ key : string ] : mixed , ... } ,
30
52
| } ;
You can’t perform that action at this time.
0 commit comments