graphql-dotnet: Query is too complex to execute. The field with the highest complexity is: GraphQLParser.AST.GraphQLFragmentSpreadWithLocation

Upgrading from 3.3 to 7.2.2, I’m getting this error when the introspection query runs from the GraphQL playground.

Not finding any info or direction to solve this one.

I did follow this: https://github.com/graphql-dotnet/graphql-dotnet/pull/3172

And change the code for Complexity on ExecuteAsync _.ComplexityConfiguration = new ComplexityConfiguration { MaxDepth = 15 };

Over to a validation rule" new ComplexityValidationRule(new ComplexityConfiguration() { MaxComplexity = 15 //Current Min. is 15 due to “IntrospectionQuery” })

I even tried upping it to 25, but that didn’t make any difference.

Thanks for the help!

{
	"errors": [{
		"message": "Query is too complex to execute. The field with the highest complexity is: GraphQLParser.AST.GraphQLFragmentSpreadWithLocation",
		"extensions": {
			"code": "COMPLEXITY",
			"codes": ["COMPLEXITY"]
		}
	}]
}

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Comments: 18 (13 by maintainers)

Most upvoted comments

FYI, the computed complexity factor was 73706 and depth of 59.

15 is toooo little 😃 @Shane32 I suggest to add calculated complexity into error message.