MaxTokensLimiter
This extension adds a validator to limit the maximum number of tokens in a GraphQL document sent to the server.
Usage example:
With the above configuration, if a client sends a query with more than 1000 tokens, the server will respond with an error message.
API reference:
max_token_count: int
The maximum allowed number of tokens in a GraphQL document.
The following things are counted as tokens:
- various brackets: ", ", ”(”, ”)”
- colon :
- words
Not counted:
- quotes