Class: GraphQL::Stitching::ExportSelection
- Inherits:
-
Object
- Object
- GraphQL::Stitching::ExportSelection
- Defined in:
- lib/graphql/stitching/export_selection.rb
Overview
Builds hidden selection fields added by stitiching code, used to request operational data about resolved objects.
Constant Summary collapse
- EXPORT_PREFIX =
"_export_"
Class Method Summary collapse
Class Method Details
.key(name) ⇒ Object
17 18 19 |
# File 'lib/graphql/stitching/export_selection.rb', line 17 def key(name) "#{EXPORT_PREFIX}#{name}" end |
.key?(name) ⇒ Boolean
11 12 13 14 15 |
# File 'lib/graphql/stitching/export_selection.rb', line 11 def key?(name) return false unless name name.start_with?(EXPORT_PREFIX) end |
.key_node(field_name) ⇒ Object
21 22 23 |
# File 'lib/graphql/stitching/export_selection.rb', line 21 def key_node(field_name) GraphQL::Language::Nodes::Field.new(alias: key(field_name), name: field_name) end |
.typename_node ⇒ Object
25 26 27 |
# File 'lib/graphql/stitching/export_selection.rb', line 25 def typename_node @typename_node ||= key_node("__typename") end |