Reputation: 9
I want to create a custom emailAddress scalar in gqlgen. So if I enter a string in a graphql schema type, it should check whether that string is in "[email protected]" format.
graphql schema
scalar EmailAddress
type User{
name: String
email: EmailAddress!
}
input user{
name: String!
email: EmailAddress!
}
type mutation{
createUser(input: user!): User!
}
this EmailAddress is what I want to create.
I wrote a code for email as well. But there are so many imports that has to be done in various files like gqlgen.yml.
So if there's anyone who was able to create a custom email scalar in gqlgen, please share your code.
Upvotes: 0
Views: 71