GraphQL using a field as argument in the same query

Viewed 42

I have constructed the following query in Gitlab's GraphQL Explorer to show my question:

https://gitlab.com/-/graphql-explorer

{
  project(fullPath: "gitlab-org/gitlab") {
    name
    repository {
      rootRef
    }
    mergeRequests(state: merged, targetBranches: "master") {
      nodes {
        sourceBranch
        targetBranch
      }
    }
  }
}

What I would like to achieve is using the value of repository { rootRef } as the argument for targetBranches.

Something like this: mergeRequests(state: merged, targetBranches: repository { rootRef }) {

Can it be done?

Thank you!

0 Answers
Related