BridgeEx.Graphql.Client (bridge_ex v0.3.0-rc.1) View Source

Documentation for BridgeEx.

Link to this section Summary

Functions

formats a GraphQL query response to make it Absinthe compliant

Link to this section Types

Specs

bridge_response() :: {:ok, term()} | {:error, String.t()}

Link to this section Functions

Link to this function

call(url, query, variables, http_options, http_headers, max_attempts)

View Source

Specs

call(
  url :: String.t(),
  query :: String.t(),
  variables :: map(),
  http_options :: Keyword.t(),
  http_headers :: map(),
  max_attempts :: integer()
) :: bridge_response()

Calls a GraphQL endpoint

Options

  • :options - HTTPoison options

  • :headers - HTTPoison headers

  • :max_attempts - Defines number of retries before returning error

Link to this function

format_response(response)

View Source

Specs

format_response(%{required(atom()) => any()} | [%{required(atom()) => any()}]) ::
  %{required(atom()) => any()} | [%{required(atom()) => any()}]

formats a GraphQL query response to make it Absinthe compliant