Skip to content

Commit d3f0edb

Browse files
authored
Update to Federation 2 (#632)
1 parent 4ccd707 commit d3f0edb

File tree

1 file changed

+33
-10
lines changed

1 file changed

+33
-10
lines changed
Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,47 @@
1-
# https://www.apollographql.com/docs/federation/federation-spec/#federation-schema-specification
2-
scalar _Any
3-
scalar _FieldSet
1+
# https://www.apollographql.com/docs/federation/subgraph-spec/
42

53
# a union of all types that use the @key directive
64
union _Entity
75

6+
scalar _Any
7+
scalar FieldSet
8+
scalar link__Import
9+
10+
enum link__Purpose {
11+
"""
12+
`SECURITY` features provide metadata necessary to securely resolve fields.
13+
"""
14+
SECURITY
15+
16+
"""
17+
`EXECUTION` features provide metadata necessary for operation execution.
18+
"""
19+
EXECUTION
20+
}
21+
822
type _Service {
9-
sdl: String
23+
sdl: String!
1024
}
1125

1226
extend type Query {
13-
_entities(representations: [_Any!]!): [_Entity]!
14-
_service: _Service!
27+
_entities(representations: [_Any!]!): [_Entity]!
28+
_service: _Service!
1529
}
1630

17-
directive @external on FIELD_DEFINITION
18-
directive @requires(fields: _FieldSet!) on FIELD_DEFINITION
19-
directive @provides(fields: _FieldSet!) on FIELD_DEFINITION
20-
directive @key(fields: _FieldSet!) repeatable on OBJECT | INTERFACE
31+
directive @external on FIELD_DEFINITION | OBJECT
32+
directive @requires(fields: FieldSet!) on FIELD_DEFINITION
33+
directive @provides(fields: FieldSet!) on FIELD_DEFINITION
34+
directive @key(fields: FieldSet!, resolvable: Boolean = true) repeatable on OBJECT | INTERFACE
35+
directive @link(url: String!, as: String, for: link__Purpose, import: [link__Import]) repeatable on SCHEMA
36+
directive @shareable repeatable on OBJECT | FIELD_DEFINITION
37+
directive @inaccessible on FIELD_DEFINITION | OBJECT | INTERFACE | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION
38+
directive @tag(name: String!) repeatable on FIELD_DEFINITION | INTERFACE | OBJECT | UNION | ARGUMENT_DEFINITION | SCALAR | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION
39+
directive @override(from: String!) on FIELD_DEFINITION
40+
directive @composeDirective(name: String!) repeatable on SCHEMA
2141

42+
# This definition is required only for libraries that don't support
43+
# GraphQL's built-in `extend` keyword
44+
#
2245
# `repeatable` is technically not part of the spec, but is added here so that multiple `type Query @extends { ... }`
2346
# definitions from different DGS schemas would pass validation
2447
directive @extends repeatable on OBJECT | INTERFACE

0 commit comments

Comments
 (0)