Sha256: d661f299bd9c08864fab091f46f556a42dac2f9f1950f7b1cb472edaf81f3f36

Contents?: true

Size: 813 Bytes

Versions: 5

Compression:

Stored size: 813 Bytes

Contents

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

        def result
          return {} if resolved_type.nil?
          selections = ast_fragment.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/fragment_spread_resolution.rb
graphql-0.8.1 lib/graphql/query/serial_execution/fragment_spread_resolution.rb
graphql-0.8.0 lib/graphql/query/serial_execution/fragment_spread_resolution.rb
graphql-0.7.1 lib/graphql/query/serial_execution/fragment_spread_resolution.rb
graphql-0.7.0 lib/graphql/query/serial_execution/fragment_spread_resolution.rb