RFC822 spec compliant email address scalar type for GraphQL.js.
Usage
This package exports a Email scalar GraphQL.js type which is useful for ensuring a field is a valid internet email address.
;
Programmatically-constructed schemas
The type can be used in a programmatically constructed schema:
;; ;
graphql-tools
SDL withWhen using the SDL with graphql-tools, define GraphQLEmail
as the resolver for
the corresponding scalar type in the schema:
;; const typeDefs = `scalar Email type MyType { myField: Email}`; const resolvers = Email: GraphQLLEmail; typeDefs resolvers ;
Related
This project was inspired by graphql-type-json & graphql-type-uuid