Module: Gitlab::Graphql::GlobalIDCompatibility

Included in:
Mutations::BaseMutation, Resolvers::BaseResolver
Defined in:
lib/gitlab/graphql/global_id_compatibility.rb

Instance Method Summary collapse

Instance Method Details

#coerce_global_id_arguments!(args) ⇒ Object

TODO: remove this module once the compatibility layer is no longer needed. See: gitlab.com/gitlab-org/gitlab/-/issues/257883


8
9
10
11
12
13
14
15
16
17
# File 'lib/gitlab/graphql/global_id_compatibility.rb', line 8

def coerce_global_id_arguments!(args)
  global_id_arguments = self.class.arguments.values.select do |arg|
    arg.type.is_a?(Class) && arg.type <= ::Types::GlobalIDType
  end

  global_id_arguments.each do |arg|
    k = arg.keyword
    args[k] &&= arg.type.coerce_isolated_input(args[k])
  end
end