envelop-trim-inputs
v0.0.3
Published
Envelop plugin to trim all string inputs from the GraphQL request's variables
Downloads
210
Maintainers
Readme
useTrimInputs
A Envelop Plugin to automatically trim all strings on GraphQL variables before they are processed by the resolvers.
Installation
npm i envelop-trim-inputs
Usage
import { envelop } from "@envelop/core"
import { useTrimInputs } from "envelop-trim-inputs"
const getEnveloped = envelop({
plugins: [
useTrimInputs(),
// other plugins...
],
})
// Then use getEnveloped with our GraphQL server (such as Yoga for example)
Options
None atm.