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

deployment_type.rb « types « graphql « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 59b59dc4e1d3cff22b2cf0582fae903af0fdfe8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# 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'

    present_using ::Deployments::DeploymentPresenter

    authorize :read_deployment

    field :id,
      GraphQL::Types::ID,
      description: 'Global ID of the deployment.'

    field :iid,
      GraphQL::Types::ID,
      description: 'Project-level internal ID of the deployment.'

    field :ref,
      GraphQL::Types::String,
      description: 'Git-Ref that the deployment ran on.'

    field :tag,
      GraphQL::Types::Boolean,
      description: 'True or false if the deployment ran on a Git-tag.'

    field :sha,
      GraphQL::Types::String,
      description: 'Git-SHA that the deployment ran on.'

    field :created_at,
      Types::TimeType,
      description: 'When the deployment record was created.'

    field :updated_at,
      Types::TimeType,
      description: 'When the deployment record was updated.'

    field :finished_at,
      Types::TimeType,
      description: 'When the deployment finished.'

    field :status,
      Types::DeploymentStatusEnum,
      description: 'Status of the deployment.'

    field :commit,
      Types::CommitType,
      description: 'Commit details of the deployment.',
      calls_gitaly: true

    field :job,
      Types::Ci::JobType,
      description: 'Pipeline job of the deployment.',
      method: :build

    field :triggerer,
      Types::UserType,
      description: 'User who executed the deployment.',
      method: :deployed_by
  end
end