Closed datakurre closed 4 years ago
When you say data are you referring to the data coming from the server?
elm-graphql generates queries with a random hash added to each field like this:
query {
studyspace1235123: studySpace {
id2415235: id
}
}
so that you can query the same endpoint multiple times in a single query. It kind of sounds like your graphql server isn't returning a response with the requested key names.
@Jayshua That explains everything. My issue was that I was not using elm-graphql to generate my queries, but was trying to just use it to decode data queried outside Elm (because WebSocket subscriptions cannot be done in Elm anyway yet).
Once I used elm-graphql to also build the query, everything worked.
Thanks a lot. This really helped to be back on track.
I must be doing something horribly wrong, because I'm quite new to Elm, trying to do GraphQL with it for the first time, and could not find anyone having similar issue. I wonder, if I have an obvious mistake someone could point to me:
I'm unable to decode value send through port unless I rename the keys in the value to match the keys I see being expected in error. For example, when I get error like:
The error goes away and JSON is decoded into Elm values proplerly after I have renamed key "voltage" into "voltage1675858143" in my data (and similar error for every other key in my data).
My example code looks like:
Versions