Skip to content

Commit

Permalink
[RFC] GraphQL IDL additions
Browse files Browse the repository at this point in the history
This adds the type definition syntax to the GraphQL specification.
  • Loading branch information
leebyron committed Mar 22, 2016
1 parent bb45a6f commit ace9871
Show file tree
Hide file tree
Showing 3 changed files with 317 additions and 21 deletions.
57 changes: 56 additions & 1 deletion spec/Appendix B -- Grammar Summary.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,14 @@ EscapedUnicode :: /[0-9A-Fa-f]{4}/
EscapedCharacter :: one of `"` \ `/` b f n r t


## Query Document
## Document

Document : Definition+

Definition :
- OperationDefinition
- FragmentDefinition
- TypeSystemDefinition

OperationDefinition :
- SelectionSet
Expand Down Expand Up @@ -169,3 +170,57 @@ NonNullType :
Directives : Directive+

Directive : @ Name Arguments?

TypeSystemDefinition :
- SchemaDefinition
- TypeDefinition
- TypeExtensionDefinition
- DirectiveDefinition

SchemaDefinition : schema { OperationTypeDefinition+ }

OperationTypeDefinition : OperationType : NamedType

TypeDefinition :
- ScalarTypeDefinition
- ObjectTypeDefinition
- InterfaceTypeDefinition
- UnionTypeDefinition
- EnumTypeDefinition
- InputObjectTypeDefinition

ScalarTypeDefinition : scalar Name

ObjectTypeDefinition : type Name ImplementsInterfaces? { FieldDefinition+ }

ImplementsInterfaces : implements NamedType+

FieldDefinition : Name ArgumentsDefinition? : Type

ArgumentsDefinition : ( InputValueDefinition+ )

InputValueDefinition : Name : Type DefaultValue?

InterfaceTypeDefinition : interface Name { FieldDefinition+ }

UnionTypeDefinition : union Name = UnionMembers

UnionMembers :
- NamedType
- UnionMembers | NamedType

EnumTypeDefinition : enum Name { EnumValueDefinition+ }

EnumValueDefinition : EnumValue

EnumValue : Name

InputObjectTypeDefinition : input Name { InputValueDefinition+ }

TypeExtensionDefinition : extend ObjectTypeDefinition

DirectiveDefinition : directive @ Name ArgumentsDefinition? on DirectiveLocations

DirectiveLocations :
- Name
- DirectiveLocations | Name
Loading

0 comments on commit ace9871

Please sign in to comment.