It seems that using Js.Json.stringify mutates the value, How else can I do this?
I can’t find any information about this or probably don’t know how to look for it.
Any help is deeply apreciated, been trying to fix it for some time and I am very frustrated at this moment.
I think the first sentence is just the birds eye view, but there is also more context after that:
This has type:
Js.Promise.t<authResponse> (defined as Js_promise.t<authResponse>)
Somewhere wanted:
Js.Promise.t<Js.Json.t> (defined as Js_promise.t<Js.Json.t>)
The incompatible parts:
authResponse (defined as
{
"access_token": string,
"expires_in": int,
"id_token": string,
"refresh_token": string,
"scope": string,
"token_type": string
,})
vs Js.Json.t (defined as Js_json.t)
The last part gave me enough hints to understand what’s wrong