Limiting Queries
For an endpoint anyone can reach, bound what one query may ask for.
bxs"maxQueryDepth" : 8,
"maxQueryComplexity" : 200,
"introspection" : false
Depth and complexity
| Setting | Counts | Example |
|---|---|---|
maxQueryDepth | Levels of nesting. | { widget { name } } is 2. |
maxQueryComplexity | Fields. | { widget { id name } } is 3. |
Both take a whole number above zero. A query over either limit comes back with one entry in errors and no data, and no resolver is called.
Introspection
"introspection" : false refuses __schema and __type queries. __typename still works. The default is true.
The rest of a public endpoint
maskErrorskeeps exception messages from clients.@graphqlRequiresguards fields.handle()turns a request body it can't run into anerrorsentry, not an exception.