UNPKG

230 BJavaScriptView Raw
1const { GraphQLError } = require('graphql/error')
2const { isRFC3339 } = require('validator')
3
4module.exports = (value) => {
5 if (isRFC3339(value)) return true
6
7 throw new GraphQLError('Must be a date-time in RFC 3339 format')
8}