# branchCollection

```graphql
query BranchCollection($input: BranchCollectionInput!) {
  branchCollection(input: $input) {
    edges {
      cursor
    }
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
    previousCursor
  }
}
```

List the branches of a project, including its root branch. Requires project.read.

## Arguments

| Name                     | Type                   | Required | Description                                                                                                            |
| ------------------------ | ---------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------- |
| `input`                  | BranchCollectionInput! | Yes      |                                                                                                                        |
| `input.projectReference` | String!                | Yes      | Project UUID, slug, or domain. Requires project.read.                                                                  |
| `input.limit`            | Int                    |          | Page size 1–100; defaults to 20.                                                                                       |
| `input.cursor`           | String                 |          | Previous endCursor or previousCursor from this collection, principal, filters and page size.                           |
| `input.search`           | String                 |          | Case-insensitive partial branch-name match.                                                                            |
| `input.status`           | BranchCollectionStatus |          | Branch status; omit for all persisted branches, including the root branch. One of `active`, `merged`, `closed`, `all`. |

## Variables

```json
{
  "input": {
    "projectReference": "string"
  }
}
```

## Responses

| Status | Description                                     |
| ------ | ----------------------------------------------- |
| 200    | The BranchCollection! in data.branchCollection. |

## Call it

```bash
curl -X POST "https://api.veryfront.com/graphql" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "query BranchCollection($input: BranchCollectionInput!) {\n  branchCollection(input: $input) {\n    edges {\n      cursor\n    }\n    pageInfo {\n      hasNextPage\n      hasPreviousPage\n      startCursor\n      endCursor\n    }\n    previousCursor\n  }\n}",
  "variables": {
    "input": {
      "projectReference": "string"
    }
  }
}'
```

## Example response

```json
{
  "data": {
    "branchCollection": {
      "edges": [
        {
          "cursor": "string"
        }
      ],
      "pageInfo": {
        "hasNextPage": false,
        "hasPreviousPage": false,
        "startCursor": "string",
        "endCursor": "string"
      },
      "previousCursor": "string"
    }
  }
}
```
