-
Notifications
You must be signed in to change notification settings - Fork 35
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
Ensure DateTime scalar inputs are converted to string #53
Comments
It seems like @composedb/graphql-scalars is implemented as a simple pass through of the scalar types defined in the graphql-scalars package. The PR you referenced is fixing an issue in the I could implement a custom definition for the datetime scalar type (to use temporarily in place of the one being exported by graphql-scalars) but that may be overkill for a package which is currently very simple - especially with a PR pending with a fix. Happy to work on a temporary solution but wanted to get your feedback before proceeding. |
Shouldn't dates get converted into number types, or ideally to native date objects in the underlying db, so that range queries can work effectively? |
I guess the problem is that JSON doesn't have a native encoding for dates. Sigh, this was one of the reasons that MongoDB's BSON added extra types beyond the base supported in JSON. We might want to consider defining a JSON-compatible serialization format for dates so that Ceramic nodes can actually treat dates like dates |
Exactly - ceramic is importing a library which is supposed to serialize dates into strings already but there is a bug where it is not being done. They have a PR open with a potential fix but it has been inactive for a while #54 |
Thanks @morozj01, I left some comments on your PR. |
@PaulLeCam I would like to continue working on it if needed |
@ashutosh887 thanks but this has already been fixed in the mentioned PR, the latest version of ComposeDB packages have the fix. |
I'm willing to contribtute to the ecosystem @PaulLeCam |
Thanks, there are some issues labelled as "good first issue" in the Ceramic repository: https://github.com/ceramicnetwork/js-ceramic/labels/good%20first%20issue |
Just saw... @PaulLeCam |
Description
The
DateTime
scalar from thegraphql-scalars
library converts inputs to JS Date objects rather than strings as expected.There is a PR already open to fix the issue but we should address it directly here in the meantime.
Technical Information
The PR to fix the issue in
graphql-scalars
could a good solution to look into, implementing similar changes in our@composedb/graphql-scalars
package.The text was updated successfully, but these errors were encountered: