Skip to content

Parse string into Date type #807

Answered by MichalLytek
Tyrubias asked this question in Q&A
Discussion options

You must be logged in to vote

Date is Date, the JS new Date().
If you want to treat string as date, just do @Field(() => String) or find another GraphQL scalar that accepts strings and numbers as a valid date value.
JSON is not capable of transporting Date type, it has to be serialized.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Tyrubias
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants