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/types/deployment_type.rb')
-rw-r--r--app/graphql/types/deployment_type.rb18
1 files changed, 12 insertions, 6 deletions
diff --git a/app/graphql/types/deployment_type.rb b/app/graphql/types/deployment_type.rb
index 59b59dc4e1d..1c23fd44ea1 100644
--- a/app/graphql/types/deployment_type.rb
+++ b/app/graphql/types/deployment_type.rb
@@ -1,12 +1,6 @@
# frozen_string_literal: true
module Types
- # If you're considering to add a new field in DeploymentType, please follow this guideline:
- # - If the field is preloadable in batch, define it in DeploymentType.
- # In this case, you should extend DeploymentsResolver logic to preload the field. Also, add a new test that
- # fetching the specific field for multiple deployments doesn't cause N+1 query problem.
- # - If the field is NOT preloadable in batch, define it in DeploymentDetailsType.
- # This type can be only fetched for a single deployment, so you don't need to take care of the preloading.
class DeploymentType < BaseObject
graphql_name 'Deployment'
description 'The deployment of an environment'
@@ -15,6 +9,8 @@ module Types
authorize :read_deployment
+ expose_permissions Types::PermissionTypes::Deployment
+
field :id,
GraphQL::Types::ID,
description: 'Global ID of the deployment.'
@@ -65,5 +61,15 @@ module Types
Types::UserType,
description: 'User who executed the deployment.',
method: :deployed_by
+
+ field :tags,
+ [Types::DeploymentTagType],
+ description: 'Git tags that contain this deployment. ' \
+ 'This field can only be resolved for one deployment in any single request.',
+ calls_gitaly: true do
+ extension ::Gitlab::Graphql::Limit::FieldCallCount, limit: 1
+ end
end
end
+
+Types::DeploymentType.prepend_mod_with('Types::DeploymentType')