Decodes GraphQL JSON response data into typed embedded schema structs.
Uses Ecto.embedded_load/3 to recursively convert plain maps (from
Jason.decode!/1) into the generated embedded schema structs, automatically
invoking custom Ecto.Type.cast/2 callbacks for scalars and enums.
Example
json = %{"name" => "Alice", "posts" => [%{"title" => "Hello"}]}
user = Grephql.ResponseDecoder.decode!(MyApp.GetUser.User, json)
user.name #=> "Alice"
hd(user.posts).title #=> "Hello"
Summary
Functions
Decodes a JSON map into the given embedded schema module.