Sha256: f19a22cfe0b4c913f711a8308a76fa59f22cb6db5d86e0cc6d79e941fc2c92db

Contents?: true

Size: 670 Bytes

Versions: 8

Compression:

Stored size: 670 Bytes

Contents

class GraphQL::Query::FragmentSpreadResolutionStrategy
  attr_reader :result
  def initialize(ast_fragment_spread, type, target, operation_resolver)
    fragments = operation_resolver.query.fragments
    fragment_def = fragments[ast_fragment_spread.name]
    child_type = operation_resolver.query.schema.types[fragment_def.type]
    resolved_type = GraphQL::Query::TypeResolver.new(target, child_type, type).type
    if resolved_type.nil?
      @result = {}
    else
      selections = fragment_def.selections
      resolver = GraphQL::Query::SelectionResolver.new(target, resolved_type, selections, operation_resolver)
      @result = resolver.result
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
graphql-0.6.2 lib/graphql/query/fragment_spread_resolution_strategy.rb
graphql-0.6.1 lib/graphql/query/fragment_spread_resolution_strategy.rb
graphql-0.6.0 lib/graphql/query/fragment_spread_resolution_strategy.rb
graphql-0.5.0 lib/graph_ql/query/fragment_spread_resolution_strategy.rb
graphql-0.4.0 lib/graph_ql/query/fragment_spread_resolution_strategy.rb
graphql-0.3.0 lib/graph_ql/query/fragment_spread_resolution_strategy.rb
graphql-0.2.0 lib/graph_ql/query/fragment_spread_resolution_strategy.rb
graphql-0.1.0 lib/graph_ql/query/fragment_spread_resolution_strategy.rb