Skip to content

Commit

Permalink
Merge pull request #55 from facebook/constraints
Browse files Browse the repository at this point in the history
Add constraints to `EnumValue`
  • Loading branch information
leebyron committed Jul 16, 2015
2 parents 5c6e700 + a12f6df commit 5bb2bb5
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions Section 8 -- Grammar.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,24 @@ Example_param :
- C_param
- D

A grammar production may specify that certain expansions are not permitted by
using the phrase "but not" and then indicating the expansions to be excluded.

For example, the production:

SafeName : Name but not SevenCarlinWords

means that the nonterminal {SafeName} may be replaced by any sequence of
characters that could replace {Name} provided that the same sequence of
characters could not replace {SevenCarlinWords}.

A grammar may also list a number of restrictions after "but not" seperated
by "or".

For example:

NonBooleanName : Name but not `true` or `false`


## Ignored Source

Expand Down Expand Up @@ -247,7 +265,7 @@ InlineFragment : ... on TypeCondition Directives? SelectionSet

FragmentDefinition : fragment FragmentName on TypeCondition Directives? SelectionSet

FragmentName : [ lookahead ! on ] Name
FragmentName : Name but not `on`

TypeCondition : TypeName

Expand All @@ -271,7 +289,7 @@ BooleanValue :
- true
- false

EnumValue : Name
EnumValue : Name but not `true`, `false` or `null`


#### Array Value
Expand Down

0 comments on commit 5bb2bb5

Please sign in to comment.