@m0n01d Right. I did say it was wide-ranging! Perhaps a better question would be:
If you could design the perfect Elm Json API, what would that look like?
(especially if you had to teach it to an intermediate student of Elm)
But that’s too broad and varied a question. I’m green on RESTful systems and prefer my prototyping to be as simple as possible, so I do think it’s worth thinking about the interplay between Elm decoders and Json structures: I guess I’m asking for pointers/resources on all the above.
Shape
- Good call on shape, I didn’t know
Decode.index
existed! That’s handy. - Some more examples changing shape would be appreciated if they’re out there.
Building a type (from chained requests)
Task.andThen
in the example I linked to confuses me, and articles like this one make my brain fall over. Do you store intermediate values in the model? Then build your Book
once all requests are complete?
These kind of situations call for a detailed walkthrough course, in my opinion. They seem advanced to me.
GraphQL
I’ve dabbled in the past. Do you think it beats Json APIs in most cases?