Class: GraphQL::Doctor::Checks::Engine

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

Instance Method Summary collapse

Constructor Details

#initialize(source_index, runtime_ir, correlation, config) ⇒ Engine

Returns a new instance of Engine.



10
11
12
13
14
15
# File 'lib/graphql/doctor/checks/engine.rb', line 10

def initialize(source_index, runtime_ir, correlation, config)
  @source_index = source_index
  @runtime_ir = runtime_ir
  @correlation = correlation
  @config = config
end

Instance Method Details

#callObject



17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/graphql/doctor/checks/engine.rb', line 17

def call
  checks = [
    ResolverMethodPresence.new(@source_index, @config),
    ArgumentKeywordMatch.new(@source_index, @config)
  ]
  diagnostics = @correlation.matched.flat_map do |field|
    checks.flat_map { |check| check.call(field) }
  end
  diagnostics.concat(source_only_diagnostics)
  diagnostics.concat(dynamic_diagnostics)
  diagnostics.concat(orphan_diagnostics)
  diagnostics.compact
end