Method: GraphQL::Analysis::QueryComplexity#initial_value
- Defined in:
- lib/graphql/analysis/query_complexity.rb
#initial_value(query) ⇒ Object
State for the query complexity calcuation:
-
queryis needed for variables, then passed to handler -
complexities_on_typeholds complexity scores for each type in an IRep node -
skip_depthincrements for each skipped node, then decrements on the way out. While it’s greater than0, we’re visiting a skipped part of the query.
23 24 25 26 27 28 29 |
# File 'lib/graphql/analysis/query_complexity.rb', line 23 def initial_value(query) { query: query, complexities_on_type: [TypeComplexity.new], skip_depth: 0, } end |