File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -33,12 +33,14 @@ where
33
33
pub query : & ' static str ,
34
34
}
35
35
36
+ /// Represents a location inside a query string. Used in errors.
36
37
#[ derive( Debug , Serialize , Deserialize , PartialEq ) ]
37
38
pub struct Location {
38
39
line : i32 ,
39
40
column : i32 ,
40
41
}
41
42
43
+ /// Part of a path in a query. It can be an object key or an array index.
42
44
#[ derive( Debug , Serialize , Deserialize , PartialEq ) ]
43
45
#[ serde( untagged) ]
44
46
pub enum PathFragment {
@@ -53,8 +55,11 @@ pub enum PathFragment {
53
55
/// Spec: [https://github.com/facebook/graphql/blob/master/spec/Section%207%20--%20Response.md]
54
56
#[ derive( Debug , Serialize , Deserialize , PartialEq ) ]
55
57
pub struct GraphQLError {
58
+ /// The human-readable error message. This is the only required field.
56
59
pub message : String ,
60
+ /// Which locations in the query the error applies to.
57
61
pub locations : Option < Vec < Location > > ,
62
+ /// Which path in the query the error applies to, e.g. `["users", 0, "email"]`.
58
63
pub path : Option < Vec < PathFragment > > ,
59
64
}
60
65
You can’t perform that action at this time.
0 commit comments