I would like to automatically translate values queried with the scalar type Date
to JavaScript Date
objects client-side.
There are many examples on how to do this mapping server-side, but can the equivalent be done server-side by passing something to new ApolloClient
?
Like:
new ApolloClient({
scalars: {
Date: {
parseLiteral: value => new Date(value),
serialize: value => value.toISOString()
}
}
})