Module: Ecoportal::API::Common::GraphQL::Model::AsInput::ClassMethods

Defined in:
lib/ecoportal/api/common/graphql/model/as_input.rb

Instance Method Summary collapse

Instance Method Details

#as_input(hash, clientMutationId: '') ⇒ Object



16
17
18
19
20
21
22
23
24
# File 'lib/ecoportal/api/common/graphql/model/as_input.rb', line 16

def as_input(hash, clientMutationId: '')
  hash_input = Ecoportal::API::Common::GraphQL::HashHelpers.
    keys_to_sym_deep(hash)

  hash_input.merge!(clientMutationId: clientMutationId)

  Ecoportal::API::Common::GraphQL::HashHelpers.
    remove_nil_keys_deep(hash_input, target: :id)
end