2018-07-10 10:19:45 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Gitlab
|
|
|
|
module Graphql
|
|
|
|
module MountMutation
|
|
|
|
extend ActiveSupport::Concern
|
|
|
|
|
2018-08-27 08:35:31 -04:00
|
|
|
class_methods do
|
2019-06-26 06:42:25 -04:00
|
|
|
def mount_mutation(mutation_class, **custom_kwargs)
|
2018-07-10 10:19:45 -04:00
|
|
|
# Using an underscored field name symbol will make `graphql-ruby`
|
|
|
|
# standardize the field name
|
|
|
|
field mutation_class.graphql_name.underscore.to_sym,
|
2019-06-26 06:42:25 -04:00
|
|
|
mutation: mutation_class,
|
|
|
|
**custom_kwargs
|
2018-07-10 10:19:45 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|