Class: GraphQL::Stitching::SelectionHint
- Inherits:
-
Object
- Object
- GraphQL::Stitching::SelectionHint
- Defined in:
- lib/graphql/stitching/selection_hint.rb
Overview
Builds hidden selection fields added by stitiching code, used to request operational data about resolved objects.
Constant Summary collapse
- HINT_PREFIX =
"_STITCH_"
Class Method Summary collapse
Class Method Details
.key(name) ⇒ Object
17 18 19 |
# File 'lib/graphql/stitching/selection_hint.rb', line 17 def key(name) "#{HINT_PREFIX}#{name}" end |
.key?(name) ⇒ Boolean
11 12 13 14 15 |
# File 'lib/graphql/stitching/selection_hint.rb', line 11 def key?(name) return false unless name name.start_with?(HINT_PREFIX) end |
.key_node(field_name) ⇒ Object
21 22 23 |
# File 'lib/graphql/stitching/selection_hint.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/selection_hint.rb', line 25 def typename_node @typename_node ||= key_node("__typename") end |