# regions

A query of the [Archipad API](https://docs.archipad.dev/apis/archipad-graphql.md).

```graphql
regions(after: String, filter: RegionsFilterInput, first: Int): RegionConnection!
```

Lists the regions of the projects the client may reach, with their type, by page of 50 unless `first` says otherwise; `filter` narrows them, such as to the regions of some projects, of some types or of a person. Regions and projects that were deleted are left out; listed in a fixed order, project after project, so that paging neither skips nor repeats a region.

## Arguments

- `after`: `String` — Cursor of the last item already received, the `endCursor` of the previous page: returns the items after it. Pass the other arguments of the previous page unchanged, or the cursor is refused. Omitted: the first page.
- `filter`: [`RegionsFilterInput`](https://docs.archipad.dev/apis/archipad-graphql/types/RegionsFilterInput.md) — Narrows the regions; omitted: every live region the client may reach.
- `first`: `Int` = `50` — Number of items of the page, from 1 to 100.

## Returns [`RegionConnection!`](https://docs.archipad.dev/apis/archipad-graphql/types/RegionConnection.md)

```graphql
type RegionConnection
```

A page of regions, as in the GraphQL Cursor Connections Specification: `edges` carry the regions and their cursors, `pageInfo` tells whether a page follows and how to ask for it.

### Fields

- `edges`: [`[ProjectRegionEdge!]!`](https://docs.archipad.dev/apis/archipad-graphql/types/ProjectRegionEdge.md) — The regions of the page, each with its cursor.
- `pageInfo`: [`PageInfo!`](https://docs.archipad.dev/apis/archipad-graphql/types/PageInfo.md) — Where the page stands in the list.

## Example

Request:

```graphql
{
  regions {
    edges {
      cursor
    }
    pageInfo {
      endCursor
      hasNextPage
      hasPreviousPage
      startCursor
    }
  }
}
```

Response:

```json
{
  "data": {
    "regions": {
      "edges": [
        {
          "cursor": "string"
        }
      ],
      "pageInfo": {
        "endCursor": "string",
        "hasNextPage": true,
        "hasPreviousPage": true,
        "startCursor": "string"
      }
    }
  }
}
```
