Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ewen-lbh/envelop-trim-inputs

GraphQL Envelop (https://the-guild.dev/graphql/envelop) plugin to trim all string inputs on requests' variables
https://github.com/ewen-lbh/envelop-trim-inputs

Last synced: 21 days ago
JSON representation

GraphQL Envelop (https://the-guild.dev/graphql/envelop) plugin to trim all string inputs on requests' variables

Awesome Lists containing this project

README

        

# useTrimInputs

A [Envelop Plugin](https://envelop.dev/docs/plugins/) to automatically trim all strings on GraphQL variables before they are processed by the resolvers.

## Installation

```bash
npm i envelop-trim-inputs
```

## Usage

```ts
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.