ghivert/elm-graphql/4.0.0

NOTE: the latest version is 5.0.0

GraphQl.Http

This module provides helpers to directly deal with HTTP with GraphQL.

send : String -> (Result Error c -> msg) -> Decoder c -> Request a b -> Cmd msg

Send a GraphQL request directly through an HTTP post, directly decoding the data field in the response.

sendMyAwesomeRequest : (Result Http.Error a -> msg) -> Decoder a -> Cmd msg
sendMyAwesomeRequest msg decoder =
  GraphQl.query myAwesomeRequest
    |> GraphQl.Http.send "/example_endpoint" msg decoder