summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/graph-gophers/graphql-go/internal/common/directive.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/graph-gophers/graphql-go/internal/common/directive.go')
-rw-r--r--vendor/github.com/graph-gophers/graphql-go/internal/common/directive.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/vendor/github.com/graph-gophers/graphql-go/internal/common/directive.go b/vendor/github.com/graph-gophers/graphql-go/internal/common/directive.go
new file mode 100644
index 00000000..f767e28f
--- /dev/null
+++ b/vendor/github.com/graph-gophers/graphql-go/internal/common/directive.go
@@ -0,0 +1,18 @@
+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
+}