|
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/ |
4 | 2 |
|
5 | 3 | # a union of all types that use the @key directive |
6 | 4 | union _Entity |
7 | 5 |
|
| 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 | + |
8 | 22 | type _Service { |
9 | | - sdl: String |
| 23 | + sdl: String! |
10 | 24 | } |
11 | 25 |
|
12 | 26 | extend type Query { |
13 | | - _entities(representations: [_Any!]!): [_Entity]! |
14 | | - _service: _Service! |
| 27 | + _entities(representations: [_Any!]!): [_Entity]! |
| 28 | + _service: _Service! |
15 | 29 | } |
16 | 30 |
|
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 |
21 | 41 |
|
| 42 | +# This definition is required only for libraries that don't support |
| 43 | +# GraphQL's built-in `extend` keyword |
| 44 | +# |
22 | 45 | # `repeatable` is technically not part of the spec, but is added here so that multiple `type Query @extends { ... }` |
23 | 46 | # definitions from different DGS schemas would pass validation |
24 | 47 | directive @extends repeatable on OBJECT | INTERFACE |
0 commit comments