# discount

> Throws an error if the discount doesn't exist, requires an authenticated user or is invalid (expired, consumed etc)

Source: https://docs.gastrogate.io/docs/api/queries/discount

```graphql
discount(
  restaurantId: ID!
  code: String!
): Discount
```

## Arguments

| Name | Type | Description |
| --- | --- | --- |
| `restaurantId` | [`ID`](https://docs.gastrogate.io/docs/api/types/ID.md)! |  |
| `code` | [`String`](https://docs.gastrogate.io/docs/api/types/String.md)! |  |

## Returns

[`Discount`](https://docs.gastrogate.io/docs/api/types/Discount.md)

## Example

```graphql
query Discount($restaurantId: ID!, $code: String!) {
  discount(restaurantId: $restaurantId, code: $code) {
    id
    isDisabled
    code
    title
    description
    validFrom
  }
}
```

```bash
curl https://api.thelocoapp.com/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $LOCO_API_KEY" \
  -d '{"query": "query { discount(...) { __typename } }"}'
```
