harmboschloo/graphql-to-elm/1.0.0

GraphQL.Response

The GraphQL response type. See http://spec.graphql.org/June2018/#sec-Response.

type Response e a
= Data a
| Errors e (Optional a)
mapData : (a -> b) -> Response e a -> Response e b

Converts the data type of the response.

mapErrors : (e1 -> e2) -> Response e1 a -> Response e2 a

Converts the errors type of the response.

toResult : Response e a -> Result e a

Converts a Response to a Result. Note that the optional data in the Errors case will be lost.

decoder : Operation t e a -> Decoder (Response e a)

Decoder for the response of an operation.