#import "../fragments/cluster_agent.fragment.graphql"

query getAgents($defaultBranchName: String!, $projectPath: ID!) {
  project(fullPath: $projectPath) {
    id
    clusterAgents {
      nodes {
        ...ClusterAgentFragment
      }
    }

    ciAccessAuthorizedAgents {
      nodes {
        agent {
          ...ClusterAgentFragment
        }
      }
    }

    userAccessAuthorizedAgents {
      nodes {
        agent {
          ...ClusterAgentFragment
        }
      }
    }

    repository {
      tree(path: ".gitlab/agents", ref: $defaultBranchName) {
        trees {
          nodes {
            id
            name
            path
            webPath
          }
        }
      }
    }
  }
}
