Skip to content

Commit

Permalink
Early return in shouldIncludeNode if directives empty
Browse files Browse the repository at this point in the history
  • Loading branch information
asp24 authored and asp24 committed Apr 17, 2019
1 parent 1c95d42 commit a74abc4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions graphql/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ func getOrCreateField(c *[]CollectedField, name string, creator func() Collected
}

func shouldIncludeNode(directives ast.DirectiveList, variables map[string]interface{}) bool {
if len(directives) == 0 {
return true
}

skip, include := false, true

if d := directives.ForName("skip"); d != nil {
Expand Down

0 comments on commit a74abc4

Please sign in to comment.