lib/graphql/execution/multiplex.rb in graphql-1.9.6 vs lib/graphql/execution/multiplex.rb in graphql-1.9.7

- old
+ new

@@ -173,10 +173,14 @@ def instrument_and_analyze(multiplex) GraphQL::Execution::Instrumentation.apply_instrumenters(multiplex) do schema = multiplex.schema multiplex_analyzers = schema.multiplex_analyzers if multiplex.max_complexity - multiplex_analyzers += [GraphQL::Analysis::MaxQueryComplexity.new(multiplex.max_complexity)] + multiplex_analyzers += if schema.using_ast_analysis? + [GraphQL::Analysis::AST::MaxQueryComplexity] + else + [GraphQL::Analysis::MaxQueryComplexity.new(multiplex.max_complexity)] + end end schema.analysis_engine.analyze_multiplex(multiplex, multiplex_analyzers) yield end