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



27
28
29
30
31
32
33
34
35
# File 'lib/ecoportal/api/common/graphql/model/as_input.rb', line 27

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