mhallin/graphql_ppx

Error: Unbound value json_of_Datetime

rauanmayemir opened this issue · 5 comments

Since the upgrade to bucklescript@4.0.3 and graphql_ppx@0.2.6 all scalar types stopped working.

Compiler crashes with an error like The value json_of_ScalarType can't be found.

I'm guessing 0.2.6 brought a regression, because pinning to graphql_ppx@0.2.4 helps.

It unfortunately sounds like custom scalar encoding might be broken in the latest release, yes. I'll try to get a fix released as soon as possible.

I thought this is a feature. Haha. I have a lot of scala and the previous verisons, I have to cast the type with %identity hack. this time, I just provide a function in scope

Yeah, I thought of adding those functions myself, but was unsure.

This issue is fixed in 0.2.7.

I suggest using Js.Json.string or whatever function you want to produce a Js.Json.t out of your native type, rather than relying on the %identity hack though.