-
As I understand DateTime was taken from graphql-iso-date. In that repo the return type from serialize is 'String' while here it is 'Date'. Is there anyway to regain that functionality? In the documentation on graphql-scalars website for DateTime it mentions date-time string. Is there a way that all DateTime types be sent to the client in String format without having to specify it on every resolver? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
You can see DateTime scalar's Result Coercion section for the behavior. Due to the JSON serialization, Date instances are converted to JSON string so the client should receive string not Date objects. If you see this does opposite, please share a failing test or a reproduction so we can help you better :) |
Beta Was this translation helpful? Give feedback.
You can see DateTime scalar's Result Coercion section for the behavior. Due to the JSON serialization, Date instances are converted to JSON string so the client should receive string not Date objects. If you see this does opposite, please share a failing test or a reproduction so we can help you better :)