graphql-type-validator

0.0.2 • Public • Published

graphql-type-validator

Custom validations for graphql scalars

Example:

import graphqlValidator from 'graphql-type-validator'
 
const GraphQLPrimitiveType = graphqlValidator({
    name: 'StringOrNumber'
    validate: function(value) {
        return typeof value === 'string' || typeof value === 'number'
    },
    error: 'Custom error message'
})

Readme

Keywords

Package Sidebar

Install

npm i graphql-type-validator

Weekly Downloads

1

Version

0.0.2

License

MIT

Last publish

Collaborators

  • adhbh