graphql_federated_graph/directives/
federation.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
use crate::{InterfaceId, ObjectId, OverrideLabel, OverrideSource, SelectionSet, StringId, SubgraphId, Type};

///```ignore,graphql
/// directive @join__type(
///     graph: join__Graph!,
///     key: join__FieldSet,
///     extension: Boolean! = false,
///     resolvable: Boolean! = true,
///     isInterfaceObject: Boolean! = false
/// ) repeatable on OBJECT | INTERFACE | UNION | ENUM | INPUT_OBJECT | SCALAR
///```
#[derive(Clone, PartialEq, PartialOrd, Debug)]
pub struct JoinTypeDirective {
    pub subgraph_id: SubgraphId,
    pub key: Option<SelectionSet>,
    pub resolvable: bool,
    pub is_interface_object: bool,
}

///```ignore,graphql
/// directive @join__field(
///     graph: join__Graph,
///     requires: join__FieldSet,
///     provides: join__FieldSet,
///     type: String,
///     external: Boolean,
///     override: String,
///     overrideLabel: String
/// ) repeatable on FIELD_DEFINITION | INPUT_FIELD_DEFINITION
/// ```
#[derive(Default, Clone, PartialEq, PartialOrd, Debug)]
pub struct JoinFieldDirective {
    pub subgraph_id: Option<SubgraphId>,
    pub requires: Option<SelectionSet>,
    pub provides: Option<SelectionSet>,
    pub r#type: Option<Type>,
    pub r#override: Option<OverrideSource>,
    pub override_label: Option<OverrideLabel>,
}

///```ignore,graphql
/// directive @join__implements(
///     graph: join__Graph!,
///     interface: String!
/// ) repeatable on OBJECT | INTERFACE
/// ```
#[derive(Clone, PartialEq, PartialOrd, Debug)]
pub struct JoinImplementsDirective {
    pub subgraph_id: SubgraphId,
    pub interface_id: InterfaceId,
}

///```ignore,graphql
/// directive @join__unionMember(
///     graph: join__Graph!,
///     member: String!
/// ) repeatable on UNION
///```
#[derive(Clone, PartialEq, PartialOrd, Debug)]
pub struct JoinUnionMemberDirective {
    pub subgraph_id: SubgraphId,
    pub object_id: ObjectId,
}

///```ignore,graphql
/// directive @join__enumValue(
///     graph: join__Graph!
/// ) repeatable on ENUM_VALUE
///```
#[derive(Clone, PartialEq, PartialOrd, Debug)]
pub struct JoinEnumValueDirective {
    pub subgraph_id: SubgraphId,
}

/// ```ignore,graphql
/// directive @join__graph(name: String!) on SCHEMA
/// ```
#[derive(Clone, PartialEq, PartialOrd, Debug)]
pub struct JoinGraphDirective {
    pub name: StringId,
    pub url: Option<StringId>,
}