5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-11-14 05:00:27 +00:00
matterbridge/vendor/github.com/graph-gophers/graphql-go/internal/common/directive.go

19 lines
411 B
Go
Raw Normal View History

2022-03-31 22:23:19 +00:00
package common
import "github.com/graph-gophers/graphql-go/types"
func ParseDirectives(l *Lexer) types.DirectiveList {
var directives types.DirectiveList
for l.Peek() == '@' {
l.ConsumeToken('@')
d := &types.Directive{}
d.Name = l.ConsumeIdentWithLoc()
d.Name.Loc.Column--
if l.Peek() == '(' {
d.Arguments = ParseArgumentList(l)
}
directives = append(directives, d)
}
return directives
}