Sha256: 73a9fac5c132ef917cbe693534cbcf734822c7a2d149ee7c8f35fe6bf400f1ce

Contents?: true

Size: 734 Bytes

Versions: 5

Compression:

Stored size: 734 Bytes

Contents

module GraphQL
  class Query
    class SerialExecution
      class InlineFragmentResolution  < GraphQL::Query::BaseExecution::SelectedObjectResolution
        attr_reader :resolved_type
        def initialize(ast_node, type, target, query, execution_strategy)
          super
          child_type = query.schema.types[ast_node.type]
          @resolved_type = GraphQL::Query::TypeResolver.new(target, child_type, type).type
        end

        def result
          return {} if resolved_type.nil?
          selections = ast_node.selections
          resolver = execution_strategy.selection_resolution.new(target, resolved_type, selections, query, execution_strategy)
          resolver.result
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
graphql-0.9.2 lib/graphql/query/serial_execution/inline_fragment_resolution.rb
graphql-0.8.1 lib/graphql/query/serial_execution/inline_fragment_resolution.rb
graphql-0.8.0 lib/graphql/query/serial_execution/inline_fragment_resolution.rb
graphql-0.7.1 lib/graphql/query/serial_execution/inline_fragment_resolution.rb
graphql-0.7.0 lib/graphql/query/serial_execution/inline_fragment_resolution.rb