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 cannot represent an invalid date-time-string #395

Closed
marcoreni opened this issue Jun 26, 2020 · 2 comments
Closed

DateTime cannot represent an invalid date-time-string #395

marcoreni opened this issue Jun 26, 2020 · 2 comments

Comments

@marcoreni
Copy link

I assume this is related to #380

After updating to 1.2.1 from 1.1.5 I'm receiving this error:
DateTime cannot represent an invalid date-time-string 2020-06-01T10:02:00+0000.

I see that https://github.com/Urigo/graphql-scalars/blob/master/src/scalars/iso-date/validator.ts#L120 validation fails because my TZ is missing : (my backend is using RFC822 format); Javascript Date.parse() seems to be fine about it:

Date.parse("2020-06-05T09:37:00+0000")
1591349820000
Date.parse("2020-06-05T09:37:00+00:00")
1591349820000

In the previous version, the serializer "coerced" the non-iso input into a valid output, but this apparently is not the case anymore.

What is the expected way of handling DateTimes? Do I have to convert the date in the RFC3339-ISO8601 format in my resolvers?

(PS: Release notes are missing for 1.1.8 onward)

@Nainterceptor
Copy link

Same issue here. I've locked to 1.1.5

ardatan added a commit that referenced this issue Jul 30, 2020
@ardatan
Copy link
Collaborator

ardatan commented Jul 30, 2020

The old behavior is available in 1.2.6!

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

No branches or pull requests

3 participants