New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@winninjs/graphql-io-utils

Package Overview
Dependencies
Maintainers
11
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@winninjs/graphql-io-utils

Utilities directives to help on graphql input validation and sanitization.

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
Maintainers
11
Weekly downloads
 
Created
Source

graphql-io-utils

Utilities directives to help on graphql input/output validation and sanitization.

Installation

npm i @winninjs/graphql-io-utils

It includes two directives:

1 - stringUtils, which lets you run a method over a string input or output

type Query{
  
  returnTrimmedAndUpper:String! @stringUtils(stringMethods:["trim","toUpperCase"]) # runs trim and toUpperCase on returned String
  
  sendTrimmedAndLower(trimmedAndLower:String!@stringUtils(stringMethods:["trim","toLowerCase"])):String! # runs trim and toLowerCase on query argument

}

2 - validate, runs common validations over input

type Query{
  email(value:String! @validate(email:true)):String! #validates if the value is an valid email
}

Currently supports the following validations:

  • email
  • url
  • alpha
  • alphaNum
  • alphaDash
  • digits
  • ip
  • hex
  • lt
  • lte
  • gt
  • gte
  • stringLengthLT
  • stringLengthLTE
  • stringLengthGT
  • stringLengthGTE
  • stringLengthEquals
  • notEmpty
  • startsWith
  • endsWith
  • contains
  • notContains

Keywords

FAQs

Package last updated on 31 Jul 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc