diff --git a/app/graphql/types/ci/pipeline_type.rb b/app/graphql/types/ci/pipeline_type.rb
index 2eeddaca6ba03bfec03a3fbb0cc17c80a6c2aa3b..f4a6c18f73eb0acc12a785caf8607bbaa9431278 100644
--- a/app/graphql/types/ci/pipeline_type.rb
+++ b/app/graphql/types/ci/pipeline_type.rb
@@ -150,6 +150,9 @@ class PipelineType < BaseObject
             description: 'A specific test suite in a pipeline test report.',
             resolver: Resolvers::Ci::TestSuiteResolver
 
+      field :ref, GraphQL::STRING_TYPE, null: true,
+            description: 'Reference to the branch from which the pipeline was triggered.'
+
       def detailed_status
         object.detailed_status(current_user)
       end
diff --git a/doc/api/graphql/reference/index.md b/doc/api/graphql/reference/index.md
index f452639d254fb2ddfd50ae383c670f68e3b51777..ca924255154ea31897d9e12f790c5ddc01747648 100644
--- a/doc/api/graphql/reference/index.md
+++ b/doc/api/graphql/reference/index.md
@@ -11237,6 +11237,7 @@ Represents a file or directory in the project repository that has been locked.
 | <a id="pipelinepath"></a>`path` | [`String`](#string) | Relative path to the pipeline's page. |
 | <a id="pipelineproject"></a>`project` | [`Project`](#project) | Project the pipeline belongs to. |
 | <a id="pipelinequeuedduration"></a>`queuedDuration` | [`Duration`](#duration) | How long the pipeline was queued before starting. |
+| <a id="pipelineref"></a>`ref` | [`String`](#string) | Reference to the branch from which the pipeline was triggered. |
 | <a id="pipelineretryable"></a>`retryable` | [`Boolean!`](#boolean) | Specifies if a pipeline can be retried. |
 | <a id="pipelinesecurityreportsummary"></a>`securityReportSummary` | [`SecurityReportSummary`](#securityreportsummary) | Vulnerability and scanned resource counts for each security scanner of the pipeline. |
 | <a id="pipelinesha"></a>`sha` | [`String!`](#string) | SHA of the pipeline's commit. |
diff --git a/spec/graphql/types/ci/pipeline_type_spec.rb b/spec/graphql/types/ci/pipeline_type_spec.rb
index 35d48229fa442ce17e824a61d753f56e24a7e122..9ba4252bcd559e5c3085fac694482768794d21b0 100644
--- a/spec/graphql/types/ci/pipeline_type_spec.rb
+++ b/spec/graphql/types/ci/pipeline_type_spec.rb
@@ -14,7 +14,7 @@
       coverage created_at updated_at started_at finished_at committed_at
       stages user retryable cancelable jobs source_job job downstream
       upstream path project active user_permissions warnings commit_path uses_needs
-      test_report_summary test_suite
+      test_report_summary test_suite ref
     ]
 
     if Gitlab.ee?