Class: GraphQL::Doctor::Checks::ArgumentKeywordMatch

Inherits:
Base
  • Object
show all
Defined in:
lib/graphql/doctor/checks/argument_keyword_match.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from GraphQL::Doctor::Checks::Base

Instance Method Details

#call(field) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/graphql/doctor/checks/argument_keyword_match.rb', line 9

def call(field)
  return [] unless field.status == :matched && field.source.confidence != :dynamic

  owner, _name, method = method_target(field)
  diagnostics = experimental_diagnostics(field, owner)
  return diagnostics unless method && !method.dynamic

  expected = expected_keywords(field)
  diagnostics.concat(argument_diagnostics(field, method, expected))
  diagnostics.concat(extra_diagnostics(field, method, expected[:extras]))
  diagnostics.concat(prepare_diagnostics(field))
  diagnostics.concat(callback_diagnostics(field, owner, expected))
  diagnostics.compact
end