Skip to content

Commit

Permalink
Separate out conditionals in collect fields
Browse files Browse the repository at this point in the history
These conditions are not really related, and I missed the second
conditional when reading through the first time.
  • Loading branch information
Mathew Byrne committed Feb 7, 2019
1 parent f7fb72e commit 76caf71
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion graphql/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ func collectFields(reqCtx *RequestContext, selSet ast.SelectionSet, satisfies []

f.Selections = append(f.Selections, sel.SelectionSet...)
case *ast.InlineFragment:
if !shouldIncludeNode(sel.Directives, reqCtx.Variables) || !instanceOf(sel.TypeCondition, satisfies) {
if !shouldIncludeNode(sel.Directives, reqCtx.Variables) {
continue
}
if !instanceOf(sel.TypeCondition, satisfies) {
continue
}
for _, childField := range collectFields(reqCtx, sel.SelectionSet, satisfies, visited) {
Expand Down

0 comments on commit 76caf71

Please sign in to comment.