Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/graphql/mutations/base_mutation.rb')
-rw-r--r--app/graphql/mutations/base_mutation.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/graphql/mutations/base_mutation.rb b/app/graphql/mutations/base_mutation.rb
index da658e1f108..5de042f78d6 100644
--- a/app/graphql/mutations/base_mutation.rb
+++ b/app/graphql/mutations/base_mutation.rb
@@ -11,7 +11,7 @@ module Mutations
field_class ::Types::BaseField
argument_class ::Types::BaseArgument
- field :errors, [GraphQL::STRING_TYPE],
+ field :errors, [GraphQL::Types::String],
null: false,
description: 'Errors encountered during execution of the mutation.'
@@ -31,6 +31,12 @@ module Mutations
def ready?(**args)
raise_resource_not_available_error! ERROR_MESSAGE if Gitlab::Database.read_only?
+ missing_args = self.class.arguments.values
+ .reject { |arg| arg.accepts?(args.fetch(arg.keyword, :not_given)) }
+ .map(&:graphql_name)
+
+ raise ArgumentError, "Arguments must be provided: #{missing_args.join(", ")}" if missing_args.any?
+
true
end