UNPKG

225 BJavaScriptView Raw
1const { GraphQLError } = require('graphql/error')
2const { isISO8601 } = require('validator')
3
4module.exports = (value) => {
5 if (isISO8601(value)) return true
6
7 throw new GraphQLError('Must be a date in ISO 8601 format')
8}