Module: GraphQL::Client::QueryTypename
Relationships & Source Files | |
Namespace Children | |
Classes:
| |
Defined in: | lib/graphql/client/query_typename.rb |
Overview
Internal: Insert __typename field selections into query.
Class Method Summary
-
.insert_typename_fields(document, types: {})
See additional method definition at line 60.
- .node_flatten_selections(selections)
Class Method Details
.insert_typename_fields(document, types: {})
See additional method definition at line 60.
# File 'lib/graphql/client/query_typename.rb', line 67
def self.insert_typename_fields(document, types: {}) visitor = InsertTypenameVisitor.new(document, types: types) visitor.visit visitor.result end
.node_flatten_selections(selections)
[ GitHub ]# File 'lib/graphql/client/query_typename.rb', line 96
def self.node_flatten_selections(selections) selections.flat_map do |selection| case selection when GraphQL::Language::Nodes::Field selection when GraphQL::Language::Nodes::InlineFragment node_flatten_selections(selection.selections) else [] end end end