Class: ActiveShopifyGraphQL::Query::Node::CurrentCustomer
- Inherits:
-
ActiveShopifyGraphQL::Query::Node
- Object
- ActiveShopifyGraphQL::Query::Node
- ActiveShopifyGraphQL::Query::Node::CurrentCustomer
- Defined in:
- lib/active_shopify_graphql/query/node/current_customer.rb
Overview
Renders a query that doesn't require an ID parameter. Used for Customer Account API's current customer query. Example:
query getCurrentCustomer {
customer {
...CustomerFragment
}
}
Constant Summary
Constants inherited from ActiveShopifyGraphQL::Query::Node
PAGE_INFO_FIELDS, STRING_KEYS_NEEDING_QUOTES
Instance Attribute Summary collapse
-
#fragment_name ⇒ Object
readonly
Returns the value of attribute fragment_name.
-
#fragments ⇒ Object
readonly
Returns the value of attribute fragments.
-
#model_type ⇒ Object
readonly
Returns the value of attribute model_type.
-
#query_name ⇒ Object
readonly
Returns the value of attribute query_name.
Attributes inherited from ActiveShopifyGraphQL::Query::Node
#alias_name, #arguments, #children, #name
Instance Method Summary collapse
-
#initialize(model_type:, query_name:, fragment_name:, fragments: []) ⇒ CurrentCustomer
constructor
A new instance of CurrentCustomer.
- #to_s ⇒ Object
Methods inherited from ActiveShopifyGraphQL::Query::Node
Constructor Details
#initialize(model_type:, query_name:, fragment_name:, fragments: []) ⇒ CurrentCustomer
Returns a new instance of CurrentCustomer.
17 18 19 20 21 22 23 |
# File 'lib/active_shopify_graphql/query/node/current_customer.rb', line 17 def initialize(model_type:, query_name:, fragment_name:, fragments: []) @model_type = model_type @query_name = query_name @fragment_name = fragment_name @fragments = fragments super(name: query_name) end |
Instance Attribute Details
#fragment_name ⇒ Object (readonly)
Returns the value of attribute fragment_name.
15 16 17 |
# File 'lib/active_shopify_graphql/query/node/current_customer.rb', line 15 def fragment_name @fragment_name end |
#fragments ⇒ Object (readonly)
Returns the value of attribute fragments.
15 16 17 |
# File 'lib/active_shopify_graphql/query/node/current_customer.rb', line 15 def fragments @fragments end |
#model_type ⇒ Object (readonly)
Returns the value of attribute model_type.
15 16 17 |
# File 'lib/active_shopify_graphql/query/node/current_customer.rb', line 15 def model_type @model_type end |
#query_name ⇒ Object (readonly)
Returns the value of attribute query_name.
15 16 17 |
# File 'lib/active_shopify_graphql/query/node/current_customer.rb', line 15 def query_name @query_name end |
Instance Method Details
#to_s ⇒ Object
25 26 27 |
# File 'lib/active_shopify_graphql/query/node/current_customer.rb', line 25 def to_s "#{fragments_string} query getCurrent#{model_type} { #{query_name} { ...#{fragment_name} } }" end |