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
3333 pub query : & ' static str ,
3434}
3535
36+ /// Represents a location inside a query string. Used in errors.
3637#[ derive( Debug , Serialize , Deserialize , PartialEq ) ]
3738pub struct Location {
3839 line : i32 ,
3940 column : i32 ,
4041}
4142
43+ /// Part of a path in a query. It can be an object key or an array index.
4244#[ derive( Debug , Serialize , Deserialize , PartialEq ) ]
4345#[ serde( untagged) ]
4446pub enum PathFragment {
@@ -53,8 +55,11 @@ pub enum PathFragment {
5355/// Spec: [https://github.com/facebook/graphql/blob/master/spec/Section%207%20--%20Response.md]
5456#[ derive( Debug , Serialize , Deserialize , PartialEq ) ]
5557pub struct GraphQLError {
58+ /// The human-readable error message. This is the only required field.
5659 pub message : String ,
60+ /// Which locations in the query the error applies to.
5761 pub locations : Option < Vec < Location > > ,
62+ /// Which path in the query the error applies to, e.g. `["users", 0, "email"]`.
5863 pub path : Option < Vec < PathFragment > > ,
5964}
6065
You can’t perform that action at this time.
0 commit comments