Class: ActiveShopifyGraphQL::Query::Node::Fragment

Inherits:
ActiveShopifyGraphQL::Query::Node show all
Defined in:
lib/active_shopify_graphql/query/node/fragment.rb

Overview

Renders GraphQL fragment definitions. Example: fragment CustomerFragment on Customer { id displayName email }

Constant Summary

Constants inherited from ActiveShopifyGraphQL::Query::Node

PAGE_INFO_FIELDS, STRING_KEYS_NEEDING_QUOTES

Instance Attribute Summary

Attributes inherited from ActiveShopifyGraphQL::Query::Node

#alias_name, #arguments, #children, #name

Instance Method Summary collapse

Methods inherited from ActiveShopifyGraphQL::Query::Node

#add_child, #has_children?, #initialize

Constructor Details

This class inherits a constructor from ActiveShopifyGraphQL::Query::Node

Instance Method Details

#to_sObject



9
10
11
12
13
# File 'lib/active_shopify_graphql/query/node/fragment.rb', line 9

def to_s
  type_name = @arguments[:on]
  fields = render_children
  "fragment #{@name} on #{type_name} { #{fields.join(' ')} }"
end