Class: Types::QueryComplexityType

Inherits:
BaseObject
  • Object
show all
Defined in:
app/graphql/types/query_complexity_type.rb

Overview

rubocop: disable Graphql/AuthorizeTypes

Constant Summary collapse

ANALYZER =
GraphQL::Analysis::AST::QueryComplexity

Instance Method Summary collapse

Methods inherited from BaseObject

accepts, assignable?, authorization, authorize, authorized?, #current_user, #id

Methods included from Gitlab::Graphql::Present

#present, #unpresented

Instance Method Details

#scoreObject



25
26
27
# File 'app/graphql/types/query_complexity_type.rb', line 25

def score
  ::GraphQL::Analysis::AST.analyze_query(query, [ANALYZER]).first
end