Class: GraphQL::Stitching::Resolver::Key

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from KeyFieldSet

#==, #default_argument_name, #to_definition

Constructor Details

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

Returns a new instance of Key.



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

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.



67
68
69
# File 'lib/graphql/stitching/resolver/keys.rb', line 67

def locations
  @locations
end

Instance Method Details

#export_nodesObject



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

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