Closed PaulLeCam closed 1 year ago
@PaulLeCam
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 serialize
function of the datetime scalar which that package is exporting
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
https://github.com/ceramicstudio/js-composedb/pull/54 This could be a temporary solution if you think it's not worth waiting for them to merge that PR @stbrody @PaulLeCam
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 Please let me know if there are any other issues I could pick
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 They look quite old... I'll check if they're already resolved
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.