@escape.tech/graphql-armor-max-directives
TypeScript icon, indicating that this package has built-in type declarations

1.6.3 • Public • Published

@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

With @graphql/graphql-js

import { maxDirectivesRule } from '@escape.tech/graphql-armor-max-directives';

With @envelop/core from @the-guild-org

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
    }),
  ]
})

Keywords

none

Install

npm i @escape.tech/graphql-armor-max-directives

DownloadsWeekly Downloads

19,251

Version

1.6.3

License

MIT

Unpacked Size

11.3 kB

Total Files

8

Last publish

Collaborators

  • swan_escape
  • icarossio
  • glimow
  • steffthestunt