Class: EPlat::Shopify::GraphQL::V202407::Input

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

Direct Known Subclasses

Product, Product::Variant, Product::VariantsBulk

Constant Summary collapse

SUPPORTED_FIELDS =
[]
SUPPORTED_NAMED_ARGUMENT_FIELDS =
{}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(input = {}, **named_arguments) ⇒ Input

Returns a new instance of Input.



7
8
9
10
# File 'lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2024_07/input.rb', line 7

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_2024_07/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_2024_07/input.rb', line 2

def named_arguments
  @named_arguments
end

Instance Method Details

#to_graphql_argsObject



12
13
14
15
# File 'lib/e_plat/resource/platform_specific/shopify/graph_q_l/v_2024_07/input.rb', line 12

def to_graphql_args
    args = named_arguments.present? ? named_arguments_with_allowed_fields(named_arguments) : { input: allowed_fields }
    format_graphql_args(args)
end