diff options
Diffstat (limited to 'app/graphql/types/ci/job_type.rb')
-rw-r--r-- | app/graphql/types/ci/job_type.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/graphql/types/ci/job_type.rb b/app/graphql/types/ci/job_type.rb index 83054553bd8..f25fc56a588 100644 --- a/app/graphql/types/ci/job_type.rb +++ b/app/graphql/types/ci/job_type.rb @@ -17,6 +17,8 @@ module Types description: 'Duration of the job in seconds.' field :id, ::Types::GlobalIDType[::CommitStatus].as('JobID'), null: true, description: 'ID of the job.' + field :kind, type: ::Types::Ci::JobKindEnum, null: false, + description: 'Indicates the type of job.' field :name, GraphQL::Types::String, null: true, description: 'Name of the job.' field :needs, BuildNeedType.connection_type, null: true, @@ -87,6 +89,12 @@ module Types field :triggered, GraphQL::Types::Boolean, null: true, description: 'Whether the job was triggered.' + def kind + return ::Ci::Build unless [::Ci::Build, ::Ci::Bridge].include?(object.class) + + object.class + end + def pipeline Gitlab::Graphql::Loaders::BatchModelLoader.new(::Ci::Pipeline, object.pipeline_id).find end |