Class: GraphQL::Doctor::Checks::Engine
- Inherits:
-
Object
- Object
- GraphQL::Doctor::Checks::Engine
- Defined in:
- lib/graphql/doctor/checks/engine.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(source_index, runtime_ir, correlation, config) ⇒ Engine
constructor
A new instance of Engine.
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
#call ⇒ Object
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 |