Sha256: a1dcf9f95663d60c303618503fee7133826e5e2d7eea68ef709cb503307ffb0d
Contents?: true
Size: 1.17 KB
Versions: 12
Compression:
Stored size: 1.17 KB
Contents
module GraphQL class Query class SerialExecution class SelectionResolution attr_reader :target, :type, :irep_node, :execution_context def initialize(target, type, irep_node, execution_context) @target = target @type = type @irep_node = irep_node @execution_context = execution_context end def result irep_node.children.each_with_object({}) do |(name, irep_node), memo| if GraphQL::Execution::DirectiveChecks.include?(irep_node, execution_context.query) && applies_to_type?(irep_node, type) field_result = execution_context.strategy.field_resolution.new( irep_node, type, target, execution_context ).result memo.merge!(field_result) end end end private def applies_to_type?(irep_node, current_type) irep_node.definitions.any? { |potential_type, field_defn| GraphQL::Execution::Typecast.compatible?(current_type, potential_type, execution_context.query.context) } end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems