Skip to content

Commit 7cf660e

Browse files
committed
graphql_query_derive: add Clone to data structures
This allows for them to be cloned out of the caches.
1 parent 8972c3d commit 7cf660e

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

graphql_query_derive/src/enums.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ use proc_macro2::{Ident, Span, TokenStream};
22

33
pub const ENUMS_PREFIX: &str = "";
44

5-
#[derive(Debug, PartialEq)]
5+
#[derive(Debug, Clone, PartialEq)]
66
pub struct EnumVariant {
77
pub description: Option<String>,
88
pub name: String,
99
}
1010

11-
#[derive(Debug, PartialEq)]
11+
#[derive(Debug, Clone, PartialEq)]
1212
pub struct GqlEnum {
1313
pub description: Option<String>,
1414
pub name: String,

graphql_query_derive/src/inputs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use query::QueryContext;
99
use std::collections::HashMap;
1010

1111
/// Represents an input object type from a GraphQL schema
12-
#[derive(Debug, PartialEq)]
12+
#[derive(Debug, Clone, PartialEq)]
1313
pub struct GqlInput {
1414
pub description: Option<String>,
1515
pub name: String,

graphql_query_derive/src/interfaces.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use std::borrow::Cow;
88
use std::collections::HashSet;
99
use unions::union_variants;
1010

11-
#[derive(Debug, PartialEq)]
11+
#[derive(Debug, Clone, PartialEq)]
1212
pub struct GqlInterface {
1313
pub description: Option<String>,
1414
pub implemented_by: HashSet<String>,

graphql_query_derive/src/objects.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use selection::*;
99
use shared::{field_impls_for_selection, response_fields_for_selection};
1010
use std::borrow::Cow;
1111

12-
#[derive(Debug, PartialEq)]
12+
#[derive(Debug, Clone, PartialEq)]
1313
pub struct GqlObject {
1414
pub description: Option<String>,
1515
pub fields: Vec<GqlObjectField>,

graphql_query_derive/src/scalars.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use proc_macro2;
22

3-
#[derive(Debug, PartialEq, PartialOrd, Ord, Eq)]
3+
#[derive(Debug, Clone, PartialEq, PartialOrd, Ord, Eq)]
44
pub struct Scalar {
55
pub name: String,
66
pub description: Option<String>,

graphql_query_derive/src/schema.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use unions::GqlUnion;
1212

1313
pub const DEFAULT_SCALARS: &[&str] = &["ID", "String", "Int", "Float", "Boolean"];
1414

15-
#[derive(Debug, PartialEq)]
15+
#[derive(Debug, Clone, PartialEq)]
1616
pub struct Schema {
1717
pub enums: BTreeMap<String, GqlEnum>,
1818
pub inputs: BTreeMap<String, GqlInput>,

graphql_query_derive/src/unions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use query::QueryContext;
55
use selection::{Selection, SelectionItem};
66
use std::collections::BTreeSet;
77

8-
#[derive(Debug, PartialEq)]
8+
#[derive(Debug, Clone, PartialEq)]
99
pub struct GqlUnion {
1010
pub description: Option<String>,
1111
pub variants: BTreeSet<String>,

0 commit comments

Comments
 (0)