Skip to content

Commit a37217b

Browse files
committed
Minor documentation improvements
1 parent 98373aa commit a37217b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff 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)]
3738
pub 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)]
4446
pub 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)]
5557
pub 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

0 commit comments

Comments
 (0)