Class: GraphQL::Stitching::TypeResolver::Key

Inherits:
KeyFieldSet
  • Object
show all
Defined in:
lib/graphql/stitching/type_resolver/keys.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from KeyFieldSet

#==, #primitive_name, #to_definition

Constructor Details

#initialize(fields, locations: GraphQL::Stitching::EMPTY_ARRAY) ⇒ Key

Returns a new instance of Key.



68
69
70
71
72
73
74
# File 'lib/graphql/stitching/type_resolver/keys.rb', line 68

def initialize(fields, locations: GraphQL::Stitching::EMPTY_ARRAY)
  super(fields)
  @locations = locations
  to_definition
  export_nodes
  freeze
end

Instance Attribute Details

#locationsObject (readonly)

Returns the value of attribute locations.



66
67
68
# File 'lib/graphql/stitching/type_resolver/keys.rb', line 66

def locations
  @locations
end

Instance Method Details

#export_nodesObject



76
77
78
79
80
81
82
# File 'lib/graphql/stitching/type_resolver/keys.rb', line 76

def export_nodes
  @export_nodes ||= begin
    nodes = map(&:export_node)
    nodes << TYPENAME_EXPORT_NODE
    nodes
  end
end