How to format datetime scalar in query? #2290
Answered
by
ryands17
ryanking1809
asked this question in
Q&A
-
Say I had a query to find all query {
posts(where: {createdAt: {lt: now()}}) {
id,
}
} Perhaps this is a Nexus, not a Prisma issue? |
Beta Was this translation helpful? Give feedback.
Answered by
ryands17
Apr 24, 2020
Replies: 1 comment 1 reply
-
Hey @ryanking1809 👋
So you could query for posts in the following manner, query {
posts(where: { createdAt: { lt: new Date() } }) {
id,
}
} or you could pass a Let me know if that solves this! |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
ryanking1809
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey @ryanking1809 👋
createdAt
will accept arguments for data types that are either aDate
or aString
.So you could query for posts in the following manner,
or you could pass a
timestamp
value as aString
as well.Let me know if that solves this!