Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions spec/Appendix C -- Grammar Summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,12 @@ FieldsDefinition : { FieldDefinition+ }
FieldDefinition : Description? Name ArgumentsDefinition? : Type
Directives[Const]?

FieldExtension :

- extend field MemberCoordinate ImplementsInterfaces? Directives[const]?
Comment thread
egoodwinx marked this conversation as resolved.
Outdated
[lookahead != `{`]
Comment thread
egoodwinx marked this conversation as resolved.
Outdated
- extend field description MemberCoordinate [lookahead != `{`]

ArgumentsDefinition : ( InputValueDefinition+ )

InputValueDefinition : Description? Name : Type DefaultValue? Directives[Const]?
Expand All @@ -329,6 +335,10 @@ InterfaceTypeDefinition :
- Description? interface Name ImplementsInterfaces? Directives[Const]?
[lookahead != `{`]

InterfaceFieldExtension :

- extend interface MemberCoordinate Directives[const]?
Comment thread
egoodwinx marked this conversation as resolved.
Outdated

InterfaceTypeExtension :

- extend interface Name ImplementsInterfaces? Directives[Const]?
Expand Down
58 changes: 58 additions & 0 deletions spec/Section 3 -- Type System.md
Original file line number Diff line number Diff line change
Expand Up @@ -1105,6 +1105,36 @@ Object type extensions have the potential to be invalid if incorrectly defined.
6. The resulting extended object type must be a super-set of all interfaces it
implements.

### Field Extensions

FieldExtension :

- extend field MemberCoordinate ImplementsInterfaces? Directives[const]?
[lookahead != `{`]
- extend field description MemberCoordinate [lookahead != `{`]

Field extensions are used to represent a field which has been extended from some
previously defined field. For example this may be a GraphQL service which is
Comment thread
martinbonnin marked this conversation as resolved.
Outdated
itself an extension of another GraphQL service.

In this example, we can deprecate the id field on the User type.

```graphql example
extend field User.name @deprecated(”Some reason”)
Comment thread
martinbonnin marked this conversation as resolved.
Outdated
```

** Field Validation **
Comment thread
martinbonnin marked this conversation as resolved.
Outdated

Field validation have the potential to be invalid if incorrectly defined.
Comment thread
martinbonnin marked this conversation as resolved.
Outdated

1. The field must already be defined and a field for a Type
Comment thread
egoodwinx marked this conversation as resolved.
Outdated
2. Any non-repeatable directives provided must not already apply to the previous
field.
3. Any interfaces provided must not be already implemented by the previous
Comment thread
martinbonnin marked this conversation as resolved.
field.
4. The resulting extended field must be a super-set of all interfaces it
implements.
Comment thread
egoodwinx marked this conversation as resolved.

## Interfaces

InterfaceTypeDefinition :
Expand Down Expand Up @@ -1358,6 +1388,34 @@ defined.
6. The resulting extended Interface type must be a super-set of all Interfaces
it implements.

#### Interface Field Extensions

InterfaceFieldExtension :

- extend interface MemberCoordinate Directives[const]?

Interface field extensions are used to represent an interface which has been
extended from some previous interface. For example this may be a GraphQL service
which is itself an extension of another GraphQL service.

In this example, the name field on the User type is deprecated for an interface.

```graphql example
extend interface User.name @deprecated("Some reason.")
```

** Field Validation **

Field validation have the potential to be invalid if incorrectly defined.

1. The field must already be defined and a field for a Type
2. Any non-repeatable directives provided must not already apply to the previous
field.
3. Any interfaces provided must not be already implemented by the previous
field.
4. The resulting extended field must be a super-set of all interfaces it
implements.

## Unions

UnionTypeDefinition : Description? union Name Directives[Const]?
Expand Down