Closed jaredh159 closed 3 years ago
Please try to add the following line to your schema definition: DateScalar(formatter: ISO8601DateFormatter())
. This will register a Date
Scalar
with the iso8601 date format.
Does this work for you?
Works great, that was simple. Thanks for your time. 👍
Can you provide any input on how to expose
@Timestamp
model properties likecreatedAt
,updatedAt
, on graphql types? I tried just addingScalar(Date.self)
to my Schema, but I end up just getting numbers (like"createdAt": 648570561.42727697
) in the json output.After digging around a bit, I think I might need to somehow register a
DateScalar
with aGraphiti.DateFormatter
, but I'm struggling to figure out where or how.I debated opening this on the Swift Graphiti repo, but since it tied in directly with Vapor/Fluent, I thought maybe it might be appropriate here. But feel free to close if you think I should raise it over there instead.
Thanks again!