graphql/scalars/docs/scalars/date-time #2895
Replies: 1 comment
-
Eg usage: Import in your import { mergeResolvers } from '@graphql-tools/merge'
import { DateTimeResolver, EmailAddressResolver, URLResolver } from 'graphql-scalars'
const scalars = {
DateTime: DateTimeResolver,
EmailAddress: EmailAddressResolver,
URL: URLResolver,
}
const resolversArray = mergeResolvers([
scalars,
// authResolvers, postResolvers, etc.
])
export default resolversArray Then use in scalar DateTime
scalar EmailAddress
scalar URL
type User {
id: ID!
profilePic: URL!
createdAt: DateTime!
email: EmailAddress!
bio: String @constraint(maxLength: 280)
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
graphql/scalars/docs/scalars/date-time
Common custom GraphQL Scalars for precise type-safe GraphQL schemas
https://the-guild.dev/graphql/scalars/docs/scalars/date-time?utm_source=chatgpt.com
Beta Was this translation helpful? Give feedback.
All reactions