graphql-type-validator
v0.0.2
Published
GraphQL Type Validator
Downloads
8
Readme
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'
})