Class: EPlat::Shopify::GraphQL::V202510::Input

Inherits:
Object
  • Object
show all
Defined in:
lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2025_10/input.rb

Direct Known Subclasses

Product, Product::Variant, Product::VariantsBulk

Constant Summary collapse

SUPPORTED_FIELDS =
[]
SUPPORTED_NAMED_ARGUMENT_FIELDS =
{}
USES_ELEMENT_NAME_AS_INPUT_ROOT_KEY =
true

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#inputObject

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_argumentsObject

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_inputObject



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