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

TimeOnly is expecting a TimeSpan Type #6420

Open
tympaniplayer opened this issue Aug 7, 2023 · 4 comments · May be fixed by #7749
Open

TimeOnly is expecting a TimeSpan Type #6420

tympaniplayer opened this issue Aug 7, 2023 · 4 comments · May be fixed by #7749
Assignees
Labels
Area: Scalars Issue is related to scalars 🌶️ hot chocolate
Milestone

Comments

@tympaniplayer
Copy link

Product

Hot Chocolate

Is your feature request related to a problem?

I noticed here: #4552 (comment) that when inputing a string for TimeOnly, HC is expecting a TimeSpan instead. Why is that? I would expect to be able to put in "14:00:00" as my time only but that's not the case. I noticed even the tests in that pull request use strings like that, not TimeSpans.

The solution you'd like

I would like it to have a parser for TimeOnly instead of it defaulting to TimeSpan. Maybe it was a typo? I'm going to create one for the project I'm working on. If it's good enough I'll maybe open a PR to see what y'all think.

@tympaniplayer
Copy link
Author

@michaelstaib
Copy link
Member

Because we do not really have a time scalar ... the scalar is called TimeSpan. We would not add a time scalar until there is a spec for it that goes well with the Date and DateTime spec.

@tympaniplayer
Copy link
Author

Apologies for continuing the conversation after it's closed, but I think that TimeOnly should not be supported at all then. I would argue for reverting that PR from a while ago. Because a TimeSpan != TimeOnly

@AmbroiseCouissin
Copy link

@michaelstaib In absence of that scalar in the spec, what do you think of this?

https://the-guild.dev/graphql/scalars/docs/scalars/time

@glen-84 glen-84 reopened this Nov 15, 2024
@glen-84 glen-84 self-assigned this Nov 15, 2024
@glen-84 glen-84 added this to the HC-15.0.0 milestone Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Scalars Issue is related to scalars 🌶️ hot chocolate
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants