Skip to content

Commit

Permalink
Add Query Depth
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesbayly authored Feb 10, 2025
1 parent 97daaeb commit 36ba3f7
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions docs/indexer/run_publish/references.md
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,28 @@ In the case where Worker C completes its fetch prior to Worker A and B, it will

We use the [graphql-query-complexity](https://www.npmjs.com/package/graphql-query-complexity) plugin to calculate this value.

### --query-depth

**Positive Integer (default: `5`)** - The query depth limit essentially controls the depth of joins to prevent unbounded GraphQL queries that can DDOS your database. This flag accepts a positive integer value that will change this limit. Setting a high value may cause performance issues on the query service. For example a value of 3 will allow:

```graphql
{
indexers(first: 5) { # First depth
nodes {
id
projects(first: 5) { # Second depth
nodes {
id
deployment { # Third depth
id
}
}
}
}
}
}
```

### --query-limit

**Positive Integer (default: `100`)** - The query service pagination size limit to prevent unbounded GraphQL queries and encourage the use of pagination. This flag accepts a positive integer value that will change this limit. Setting a high value may cause performance issues on the query service, it is recommended instead that queries are [paginated](https://graphql.org/learn/pagination/).
Expand Down

0 comments on commit 36ba3f7

Please sign in to comment.