File tree Expand file tree Collapse file tree 4 files changed +126
-0
lines changed
java/com/apollographql/federation/graphqljava
test/java/com/apollographql/federation/graphqljava Expand file tree Collapse file tree 4 files changed +126
-0
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ public final class Federation {
34
34
public static final String FEDERATION_SPEC_V2_5 = "https://specs.apollo.dev/federation/v2.5" ;
35
35
public static final String FEDERATION_SPEC_V2_6 = "https://specs.apollo.dev/federation/v2.6" ;
36
36
public static final String FEDERATION_SPEC_V2_7 = "https://specs.apollo.dev/federation/v2.7" ;
37
+ public static final String FEDERATION_SPEC_V2_8 = "https://specs.apollo.dev/federation/v2.8" ;
37
38
38
39
private static final SchemaGenerator .Options generatorOptions =
39
40
SchemaGenerator .Options .defaultOptions ();
Original file line number Diff line number Diff line change 8
8
import static com .apollographql .federation .graphqljava .Federation .FEDERATION_SPEC_V2_5 ;
9
9
import static com .apollographql .federation .graphqljava .Federation .FEDERATION_SPEC_V2_6 ;
10
10
import static com .apollographql .federation .graphqljava .Federation .FEDERATION_SPEC_V2_7 ;
11
+ import static com .apollographql .federation .graphqljava .Federation .FEDERATION_SPEC_V2_8 ;
11
12
import static graphql .introspection .Introspection .DirectiveLocation .FIELD_DEFINITION ;
12
13
import static graphql .introspection .Introspection .DirectiveLocation .INTERFACE ;
13
14
import static graphql .introspection .Introspection .DirectiveLocation .OBJECT ;
@@ -229,6 +230,8 @@ public static List<SDLNamedDefinition> loadFederationSpecDefinitions(String fede
229
230
return loadFed2Definitions ("definitions_fed2_6.graphqls" );
230
231
case FEDERATION_SPEC_V2_7 :
231
232
return loadFed2Definitions ("definitions_fed2_7.graphqls" );
233
+ case FEDERATION_SPEC_V2_8 :
234
+ return loadFed2Definitions ("definitions_fed2_8.graphqls" );
232
235
default :
233
236
throw new UnsupportedFederationVersionException (federationSpec );
234
237
}
Original file line number Diff line number Diff line change
1
+ #
2
+ # https://specs.apollo.dev/federation/v2.0/federation-v2.0.graphql
3
+ #
4
+
5
+ directive @key (fields : FieldSet ! , resolvable : Boolean = true ) repeatable on OBJECT | INTERFACE
6
+ directive @requires (fields : FieldSet ! ) on FIELD_DEFINITION
7
+ directive @provides (fields : FieldSet ! ) on FIELD_DEFINITION
8
+ directive @external on OBJECT | FIELD_DEFINITION
9
+ directive @extends on OBJECT | INTERFACE
10
+ directive @inaccessible on
11
+ | FIELD_DEFINITION
12
+ | OBJECT
13
+ | INTERFACE
14
+ | UNION
15
+ | ENUM
16
+ | ENUM_VALUE
17
+ | SCALAR
18
+ | INPUT_OBJECT
19
+ | INPUT_FIELD_DEFINITION
20
+ | ARGUMENT_DEFINITION
21
+ directive @tag (name : String ! ) repeatable on
22
+ | FIELD_DEFINITION
23
+ | INTERFACE
24
+ | OBJECT
25
+ | UNION
26
+ | ARGUMENT_DEFINITION
27
+ | SCALAR
28
+ | ENUM
29
+ | ENUM_VALUE
30
+ | INPUT_OBJECT
31
+ | INPUT_FIELD_DEFINITION
32
+ scalar FieldSet
33
+
34
+ #
35
+ # https://specs.apollo.dev/link/v1.0/link-v1.0.graphql
36
+ #
37
+
38
+ directive @link (
39
+ url : String ! ,
40
+ as : String ,
41
+ import : [Import ],
42
+ for : Purpose )
43
+ repeatable on SCHEMA
44
+
45
+ scalar Import
46
+
47
+ enum Purpose {
48
+ SECURITY
49
+ EXECUTION
50
+ }
51
+
52
+ #
53
+ # federation-v2.1
54
+ #
55
+
56
+ directive @composeDirective (name : String ! ) repeatable on SCHEMA
57
+
58
+ #
59
+ # federation-v2.2
60
+ #
61
+
62
+ directive @shareable repeatable on FIELD_DEFINITION | OBJECT
63
+
64
+ #
65
+ # federation-v2.3
66
+ #
67
+
68
+ directive @interfaceObject on OBJECT
69
+
70
+ #
71
+ # federation-v2.5
72
+ #
73
+
74
+ directive @authenticated on
75
+ ENUM
76
+ | FIELD_DEFINITION
77
+ | INTERFACE
78
+ | OBJECT
79
+ | SCALAR
80
+
81
+ directive @requiresScopes (scopes : [[Scope ! ]! ]! ) on
82
+ ENUM
83
+ | FIELD_DEFINITION
84
+ | INTERFACE
85
+ | OBJECT
86
+ | SCALAR
87
+
88
+ scalar Scope
89
+
90
+ #
91
+ # federation-v2.6
92
+ #
93
+
94
+ directive @policy (policies : [[Policy ! ]! ]! ) on
95
+ ENUM
96
+ | FIELD_DEFINITION
97
+ | INTERFACE
98
+ | OBJECT
99
+ | SCALAR
100
+
101
+ scalar Policy
102
+
103
+ #
104
+ # federation-v2.7
105
+ #
106
+
107
+ directive @override (from : String ! , label : String ) on FIELD_DEFINITION
108
+
109
+ #
110
+ # federation-v2.8
111
+ #
112
+
113
+ scalar ContextFieldValue
114
+
115
+ directive @context (name : String ! ) repeatable on INTERFACE | OBJECT | UNION
116
+
117
+ directive @fromContext (field : ContextFieldValue ) on ARGUMENT_DEFINITION
Original file line number Diff line number Diff line change @@ -327,6 +327,11 @@ public void verifyFederationV2Transformation_policy() {
327
327
verifyFederationTransformation ("schemas/policy/schema.graphql" );
328
328
}
329
329
330
+ @ Test
331
+ public void verifyFederationV2Transformation_context () {
332
+ verifyFederationTransformation ("schemas/context/schema.graphql" );
333
+ }
334
+
330
335
@ Test
331
336
public void
332
337
verifyFederationV2Transformation_requiresScopesFromUnsupportedVersion_throwsException () {
You can’t perform that action at this time.
0 commit comments