Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/ewen-lbh/envelop-trim-inputs
- Owner: ewen-lbh
- License: mit
- Created: 2024-08-04T22:10:28.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-08-05T14:36:02.000Z (3 months ago)
- Last Synced: 2024-10-05T00:09:12.024Z (about 1 month ago)
- Language: TypeScript
- Homepage: https://npmjs.com/package/envelop-trim-inputs
- Size: 33.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.