Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DateTime serialization has non optional 3 digit millisecond component #59

Conversation

mursilsayed
Copy link

This PR addresses #58 using a custom DateTimeFormatter for the object serialization.

…t millisecond component is always part of the serialized string
@bbakerman bbakerman self-requested a review April 28, 2022 01:34
Copy link
Member

@bbakerman bbakerman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@bbakerman bbakerman added this to the 19.0 milestone Apr 28, 2022
@bbakerman bbakerman merged commit 1764ea8 into graphql-java:master Apr 28, 2022
@arijitdasgupta
Copy link

Hello, as far as I understand this PR, it'll always take produce 3-digits after the decimal point? Right?

Previously, it would be arbitrary with the amount of precision available from the input timestamp string. But have you considered the effect on nano-second level precision? For example the timestamp with complete nanosecond precision 2022-07-04T12:57:25.548234Z used to end up as 2022-07-04T12:57:25.548234Z, but after this change now it ends up as 2022-07-04T13:12:54.267Z?

Is this intentional?

Thanks!

Please let me know if the explanation, concern makes sense!

@dondonz
Copy link
Member

dondonz commented Jul 22, 2022

Hi @arijitdasgupta yes this is an intentional change to always produce 3 digits representing milliseconds, as per the DateTime Scalar specification on this page https://www.graphql-scalars.com/date-time/#non-optional-exact-milliseconds

This DateTime Scalar specification is stricter than the RFC specification. The RFC specification of 1 or more digits led to different numbers of digits chosen and this caused a problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants