Skip to content

Commit

Permalink
parse directive decl without arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
neelance committed Mar 17, 2017
1 parent 36f8ba8 commit 2e23573
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions internal/schema/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,13 +408,15 @@ func parseDirectiveDecl(l *lexer.Lexer) *Directive {
d.Args = make(map[string]*common.InputValue)
l.ConsumeToken('@')
d.Name = l.ConsumeIdent()
l.ConsumeToken('(')
for l.Peek() != ')' {
v := common.ParseInputValue(l)
d.Args[v.Name] = v
d.ArgOrder = append(d.ArgOrder, v.Name)
if l.Peek() == '(' {
l.ConsumeToken('(')
for l.Peek() != ')' {
v := common.ParseInputValue(l)
d.Args[v.Name] = v
d.ArgOrder = append(d.ArgOrder, v.Name)
}
l.ConsumeToken(')')
}
l.ConsumeToken(')')
l.ConsumeKeyword("on")
for {
loc := l.ConsumeIdent()
Expand Down

0 comments on commit 2e23573

Please sign in to comment.