summaryrefslogtreecommitdiff
path: root/app/graphql
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-08 00:09:30 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-08 00:09:30 +0000
commit060c842402c00f830a810702600cbe39dfa6cf62 (patch)
tree743bd65ac0c1d4d6518ae8cdd4af5718ec7fb890 /app/graphql
parent6867eff1f997a881cd3ea64109f7ba2d4b42fde4 (diff)
downloadgitlab-ce-060c842402c00f830a810702600cbe39dfa6cf62.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/graphql')
-rw-r--r--app/graphql/resolvers/environments_resolver.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/graphql/resolvers/environments_resolver.rb b/app/graphql/resolvers/environments_resolver.rb
index 868abef98eb..4e9a17f1e17 100644
--- a/app/graphql/resolvers/environments_resolver.rb
+++ b/app/graphql/resolvers/environments_resolver.rb
@@ -10,6 +10,10 @@ module Resolvers
required: false,
description: 'Search query'
+ argument :states, [GraphQL::STRING_TYPE],
+ required: false,
+ description: 'States of environments that should be included in result'
+
type Types::EnvironmentType, null: true
alias_method :project, :object
@@ -18,6 +22,8 @@ module Resolvers
return unless project.present?
EnvironmentsFinder.new(project, context[:current_user], args).find
+ rescue EnvironmentsFinder::InvalidStatesError => exception
+ raise Gitlab::Graphql::Errors::ArgumentError, exception.message
end
end
end