Skip to content

Commit f6b7f9c

Browse files
committed
graphql_query: add some simple impls for error types
1 parent 42c185e commit f6b7f9c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ where
9191
}
9292

9393
/// Represents a location inside a query string. Used in errors. See [`Error`].
94-
#[derive(Debug, Serialize, Deserialize, PartialEq)]
94+
#[derive(Debug, Clone, Copy, Default, Serialize, Deserialize, PartialEq)]
9595
pub struct Location {
9696
/// The line number in the query string where the error originated (starting from 1).
9797
pub line: i32,
@@ -100,7 +100,7 @@ pub struct Location {
100100
}
101101

102102
/// Part of a path in a query. It can be an object key or an array index. See [`Error`].
103-
#[derive(Debug, Serialize, Deserialize, PartialEq)]
103+
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
104104
#[serde(untagged)]
105105
pub enum PathFragment {
106106
/// A key inside an object
@@ -177,7 +177,7 @@ pub enum PathFragment {
177177
/// # Ok(())
178178
/// # }
179179
/// ```
180-
#[derive(Debug, Serialize, Deserialize, PartialEq)]
180+
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
181181
pub struct Error {
182182
/// The human-readable error message. This is the only required field.
183183
pub message: String,

0 commit comments

Comments
 (0)