Skip to content

Commit

Permalink
Merge pull request #2954 from benjie/patch-1
Browse files Browse the repository at this point in the history
Fix minor issues in Apollo Federation Spec
  • Loading branch information
James Baxley authored Jul 1, 2019
2 parents bf0cd6b + 4beb75c commit ca8763e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions docs/source/federation/federation-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ extend type Query {
directive @external on FIELD_DEFINITION
directive @requires(fields: _FieldSet!) on FIELD_DEFINITION
directive @provides(fields: _FieldSet!) on FIELD_DEFINITION
directive @key(fields: _FieldSet!) on OBJECT
directive @key(fields: _FieldSet!) on INTERFACE
directive @key(fields: _FieldSet!) on OBJECT | INTERFACE

# this is an optional directive discussed below
directive @extends on OBJECT
Expand Down Expand Up @@ -203,17 +202,17 @@ A new object type called `_Service` must be created. This type must have an `sdl

### `Query._service`

A new field must be added to the query root called `_service`. This field must return a non-nullable `_Service` type. The `_service` field on the query root must return SDL which includes all of the service's types (after any non-federation transforms), as well as federation directive annotations on the fields and types. The federation schema modifications (i.e. new types and directives) *should not be* included in this SDL.
A new field must be added to the query root called `_service`. This field must return a non-nullable `_Service` type. The `_service` field on the query root must return SDL which includes all of the service's types (after any non-federation transforms), as well as federation directive annotations on the fields and types. The federation schema modifications (i.e. new types and directive definitions) *should not be* included in this SDL.

### `union Entity`
### `union _Entity`

A new union called `_Entity` must be created. This should be a union of all types that use the `@key` directive, including both types native to the schema and extended types.

### `scalar _Any`

A new scalar called `_Any` must be created. The `_Any` scalar is used to pass representations of entities from external services into the root `_entities` field for execution. Validation of the `_Any` scalar is done by matching the `__typename` and `@external` fields defined in the schema.

### `scalar FieldSet`
### `scalar _FieldSet`

A new scalar called `_FieldSet` is a custom scalar type that is used to represent a set of fields. Grammatically, a field set is a [selection set](https://facebook.github.io/graphql/draft/#sec-Selection-Sets) minus the braces. This means it can represent a single field `"upc"`, multiple fields `"id countryCode"`, and even nested selection sets `"id organization { id }"`.

Expand Down

0 comments on commit ca8763e

Please sign in to comment.