diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-28 15:09:57 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-28 15:09:57 +0000 |
commit | 1d9f78b3a4ecd36806890e80e513242d0fdf7b6e (patch) | |
tree | 80ea387bd0d33a19d2213be6aa30c39d67ffb9e5 /app/graphql/mutations/base_mutation.rb | |
parent | b1e352740bd52771b419829abef0a0ad73141ac1 (diff) | |
download | gitlab-ce-1d9f78b3a4ecd36806890e80e513242d0fdf7b6e.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/graphql/mutations/base_mutation.rb')
-rw-r--r-- | app/graphql/mutations/base_mutation.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/graphql/mutations/base_mutation.rb b/app/graphql/mutations/base_mutation.rb index 72fc2043430..5de042f78d6 100644 --- a/app/graphql/mutations/base_mutation.rb +++ b/app/graphql/mutations/base_mutation.rb @@ -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 |