envelop-no-batched-queries
v3.0.2
Published
Graphql envelop plugin for no alias graphql directive. It can limit the amount of alias fields that can be used for queries and mutations. Preventing batch attacks.
Maintainers
Readme
No Batched Queries - Envelop Plugin
This package is an envelop plugin version of
graphql-no-batched-queries validation directive.
Install
npm i envelop-no-batched-queriesUsage
import { envelop } from '@envelop/core'
import { useNoBatchedQueries } from 'envelop-no-batched-queries'
// allow 2 queries or mutations per request (default is 1)
const batchValidation = useNoBatchedQueries({ allow: 2 })
const getEnveloped = envelop({
plugins: [batchValidation]
})