Character Limit
💡
This page is currently under construction and expected to change. Please feel free to reach out to us directly in case you are having any troubles.
Limit number of characters in a GraphQL query document.
This plugin helps you to prevent DoS attacks by hard-limiting the size of the query document.
How to use?
Install the plugin:
npm install @escape.tech/graphql-armor-character-limit
Then, add it to your plugins:
mesh.config.ts
import { characterLimitPlugin } from '@escape.tech/graphql-armor-character-limit'
import { defineConfig } from '@graphql-mesh/serve-cli'
export default defineConfig({
plugins: () => [
characterLimitPlugin({
maxLength: 15000 // Number of characters allowed | Default: 15000
})
]
})
💡
- We recommend using the Max Tokens Plugin instead of this one. - This plugin does not limit the size of input variables. - This plugin relies on a parser plugin to works and access query document through the context.