harmboschloo / graphql-to-elm-package / GraphQL.Response

The GraphQL response type. See https://facebook.github.io/graphql/draft/#sec-Response-Format.


type Response e a
    = Data a
    | Errors e (GraphQL.Optional.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 : GraphQL.Operation.Operation t e a -> Json.Decode.Decoder (Response e a)

Decoder for the response of an operation.