# featureGate

```graphql
query FeatureGate($input: FeatureGateCheckInput!) {
  featureGate(input: $input) {
    gate
    allowed
    requiredTier
    limit
    currentCount
  }
}
```

Check whether a plan allows a feature before offering it, for the caller or for the owner of a project; returns allowed with the required tier, limit and current count, and a denied gate is a result, not an error.

## Arguments

| Name                     | Type                   | Required | Description                                                                                                                                                                |
| ------------------------ | ---------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `input`                  | FeatureGateCheckInput! | Yes      |                                                                                                                                                                            |
| `input.gate`             | String!                | Yes      |                                                                                                                                                                            |
| `input.currentCount`     | Int                    |          |                                                                                                                                                                            |
| `input.projectReference` | String                 |          | Optional project ID or slug. When supplied for a gate other than projects, checks the project owner and requires project.read. The projects gate always checks the caller. |

## Variables

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

## Responses

| Status | Description                           |
| ------ | ------------------------------------- |
| 200    | The FeatureGate! in data.featureGate. |

## 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 FeatureGate($input: FeatureGateCheckInput!) {\n  featureGate(input: $input) {\n    gate\n    allowed\n    requiredTier\n    limit\n    currentCount\n  }\n}",
  "variables": {
    "input": {
      "gate": "string"
    }
  }
}'
```

## Example response

```json
{
  "data": {
    "featureGate": {
      "gate": "string",
      "allowed": false,
      "requiredTier": "string",
      "limit": 0,
      "currentCount": 0
    }
  }
}
```
