Chalk v0.1.0 Chalk.GraphQLRespose View Source
Response struct to graphql responses
Link to this section Summary
Functions
It builds a struct with the GraphQL response. It returs a map with either :ok
or :error
Link to this section Types
Link to this section Functions
It builds a struct with the GraphQL response. It returs a map with either :ok
or :error
##Arguments:
*raw_response, a map with grapql response that comes from HTTP request
##Examples:
iex> Response.build(%{data: %{"name" => "test_name"}}) %Response%{data: %{"name" => "test_name"}}
iex> Response.build(%{errors: %{"name" => "test_name"}}) %Response%{errors: []}