Class: EPlat::Shopify::GraphQL::V202510::Input
- Inherits:
-
Object
- Object
- EPlat::Shopify::GraphQL::V202510::Input
- Defined in:
- lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2025_10/input.rb
Direct Known Subclasses
Constant Summary collapse
- SUPPORTED_FIELDS =
[]
- SUPPORTED_NAMED_ARGUMENT_FIELDS =
{}
- USES_ELEMENT_NAME_AS_INPUT_ROOT_KEY =
true
Instance Attribute Summary collapse
-
#input ⇒ Object
Returns the value of attribute input.
-
#named_arguments ⇒ Object
Returns the value of attribute named_arguments.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(input = {}, **named_arguments) ⇒ Input
constructor
A new instance of Input.
- #query_input ⇒ Object
Constructor Details
#initialize(input = {}, **named_arguments) ⇒ Input
Returns a new instance of Input.
8 9 10 11 |
# File 'lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2025_10/input.rb', line 8 def initialize(input = {}, **named_arguments) @input = input.deep_transform_keys { |key| key.to_s.camelize(:lower) } @named_arguments = named_arguments.deep_transform_keys { |key| key.to_s.camelize(:lower) } end |
Instance Attribute Details
#input ⇒ Object
Returns the value of attribute input.
2 3 4 |
# File 'lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2025_10/input.rb', line 2 def input @input end |
#named_arguments ⇒ Object
Returns the value of attribute named_arguments.
2 3 4 |
# File 'lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2025_10/input.rb', line 2 def named_arguments @named_arguments end |
Class Method Details
.mutation_input(resource, action) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2025_10/input.rb', line 24 def self.mutation_input(resource, action) raise "mutation_input not implemented for #{self.class.name}" # example: # case action.to_sym # when :delete # new(input: { id: resource.formatted_id }) # else # new(resource.class.mapping.via_native_attributes_where_possible( # resource.class.remove_root_from(resource.as_json) # )) # end.query_input end |
Instance Method Details
#query_input ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2025_10/input.rb', line 13 def query_input args = if named_arguments.present? named_arguments_with_allowed_fields(named_arguments) else self.class::USES_ELEMENT_NAME_AS_INPUT_ROOT_KEY ? { element_name => allowed_fields } : allowed_fields end format_graphql_args(args) end |