@escape.tech/graphql-armor-max-directives
This plugin will limit the number of directives in a GraphQL query.
Getting Started
# npm
npm install @escape.tech/graphql-armor-max-directives
# yarn
yarn add @escape.tech/graphql-armor-max-directives
Usage example
@graphql/graphql-js
With import { maxDirectivesRule } from '@escape.tech/graphql-armor-max-directives';
@envelop/core
from @the-guild-org
With import { envelop } from '@envelop/core';
import { maxDirectivesPlugin } from '@escape.tech/graphql-armor-max-directives';
const getEnveloped = envelop({
plugins: [
// ... other plugins ...
maxDirectivesPlugin({
n: 50, // Number of directives allowed | Default: 50
}),
]
})