# environmentVariables

```graphql
query EnvironmentVariables($input: EnvironmentVariablesInput!) {
  environmentVariables(input: $input) {
    data {
      id
      key
      value
      hasValue
    }
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
  }
}
```

List the variables of an environment, with masked values. Requires project.read.

## Arguments

| Name                  | Type                         | Required | Description                                                                                                                                  |
| --------------------- | ---------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| `input`               | EnvironmentVariablesInput!   | Yes      |                                                                                                                                              |
| `input.environmentId` | ID!                          | Yes      | Environment UUID.                                                                                                                            |
| `input.keys`          | \[String!]                   |          | Only these keys, at most 100 of at most 255 characters each. The filter applies before pagination; a key that does not exist is not in data. |
| `input.limit`         | Int                          |          | Variables per page, 1 to 100 (default 20).                                                                                                   |
| `input.cursor`        | String                       |          | pageInfo.endCursor of the previous page; send it with the same sort.                                                                         |
| `input.sortBy`        | EnvironmentVariableSortBy    |          | Sort field: key (default) or updated\_at. Ties break by variable ID ascending. One of `key`, `updated_at`.                                   |
| `input.sortOrder`     | EnvironmentVariableSortOrder |          | Sort direction: asc (default) or desc. One of `asc`, `desc`.                                                                                 |

## Variables

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

## Responses

| Status | Description                                                |
| ------ | ---------------------------------------------------------- |
| 200    | The EnvironmentVariablePage! in data.environmentVariables. |

## 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 EnvironmentVariables($input: EnvironmentVariablesInput!) {\n  environmentVariables(input: $input) {\n    data {\n      id\n      key\n      value\n      hasValue\n    }\n    pageInfo {\n      hasNextPage\n      hasPreviousPage\n      startCursor\n      endCursor\n    }\n  }\n}",
  "variables": {
    "input": {
      "environmentId": "string"
    }
  }
}'
```

## Example response

```json
{
  "data": {
    "environmentVariables": {
      "data": [
        {
          "id": "string",
          "key": "string",
          "value": "string",
          "hasValue": false
        }
      ],
      "pageInfo": {
        "hasNextPage": false,
        "hasPreviousPage": false,
        "startCursor": "string",
        "endCursor": "string"
      }
    }
  }
}
```
