Skip to content

Commit

Permalink
Bypass complexity limit on __Schema queries.
Browse files Browse the repository at this point in the history
  • Loading branch information
tsh96 committed Aug 7, 2021
1 parent 9a214e8 commit 54cef3d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions complexity/complexity.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ func (cw complexityWalker) selectionSetComplexity(selectionSet ast.SelectionSet)
switch s := selection.(type) {
case *ast.Field:
fieldDefinition := cw.schema.Types[s.Definition.Type.Name()]

if fieldDefinition.Name == "__Schema" {
continue
}

var childComplexity int
switch fieldDefinition.Kind {
case ast.Object, ast.Interface, ast.Union:
Expand Down

0 comments on commit 54cef3d

Please sign in to comment.