Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
mfn committed Apr 14, 2021
1 parent c51bdc5 commit 8e22f91
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ To work this around:
- [Default field resolver](#default-field-resolver)
- [Macros](#macros)
- [Automatic Persisted Queries support](#automatic-persisted-queries-support)
- [Misc features](#misc-features)
- [Guides](#guides)
- [Upgrading from v1 to v2](#upgrading-from-v1-to-v2)
- [Migrating from Folklore](#migrating-from-folklore)
Expand Down Expand Up @@ -2492,6 +2493,36 @@ const app = new Vue({
</script>
```

## Misc features

### Detecting unused variables

By default, `'variables'` provided alongside the GraphQL query which are **not**
consumed, are silently ignored.

If you consider the hypothetical case you have an optional (nullable) argument
in your query, and you provide a variable argument for it but you make a typo,
this can go unnoticed.

Example:
```graphql
mutation test($value:ID) {
someMutation(type:"falbala", optional_id: $value)
}
```
Variables provided:
```json5
{
// Ops! typo in `values`
"values": "138"
}
```

In this case, nothing happens and `optional_id` will be treated as not being provided.

To prevent such scenarios, you can enable the config option `detect_unused_variables`
and set it to `true`.

## Guides

### Upgrading from v1 to v2
Expand Down

0 comments on commit 8e22f91

Please sign in to comment.