diff options
Diffstat (limited to 'app/graphql/types/ci/job_artifact_type.rb')
-rw-r--r-- | app/graphql/types/ci/job_artifact_type.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/app/graphql/types/ci/job_artifact_type.rb b/app/graphql/types/ci/job_artifact_type.rb new file mode 100644 index 00000000000..c34a12dcc61 --- /dev/null +++ b/app/graphql/types/ci/job_artifact_type.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +module Types + module Ci + # rubocop: disable Graphql/AuthorizeTypes + class JobArtifactType < BaseObject + graphql_name 'CiJobArtifact' + + field :download_path, GraphQL::STRING_TYPE, null: true, + description: "URL for downloading the artifact's file" + + field :file_type, ::Types::Ci::JobArtifactFileTypeEnum, null: true, + description: 'File type of the artifact' + + def download_path + ::Gitlab::Routing.url_helpers.download_project_job_artifacts_path( + object.project, + object.job, + file_type: object.file_type + ) + end + end + end +end |