Class: GraphQL::Query::FieldResolutionStrategy::NonNullResolutionStrategy

Inherits:
Object
  • Object
show all
Defined in:
lib/graph_ql/query/field_resolution_strategy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value, field_type, target, parent_type, ast_field, operation_resolver) ⇒ NonNullResolutionStrategy

Returns a new instance of NonNullResolutionStrategy.



69
70
71
72
73
74
75
# File 'lib/graph_ql/query/field_resolution_strategy.rb', line 69

def initialize(value, field_type, target, parent_type, ast_field, operation_resolver)
  wrapped_type = field_type.of_type
  resolved_type = wrapped_type.kind.resolve(wrapped_type, value)
  strategy_class = GraphQL::Query::FieldResolutionStrategy.get_strategy_for_kind(resolved_type.kind)
  inner_strategy = strategy_class.new(value, resolved_type, target, parent_type, ast_field, operation_resolver)
  @result = inner_strategy.result
end

Instance Attribute Details

#resultObject (readonly)

Returns the value of attribute result.



68
69
70
# File 'lib/graph_ql/query/field_resolution_strategy.rb', line 68

def result
  @result
end