diff options
Diffstat (limited to 'app/graphql/resolvers')
-rw-r--r-- | app/graphql/resolvers/environments_resolver.rb | 6 |
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 |