0.0.2 • Published 8 years ago
graphql-type-validator v0.0.2
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'
})