CommonGraphQLClient.Caller.HttpTesla (common_graphql_client v0.6.4) View Source

Tesla GraphQL Adapter

Add to the client:

def connection(opts) do

token = http_api_token(opts)

middleware = [
  {Tesla.Middleware.Headers, [{"Authorization", "Bearer " <> token}]},
  {Tesla.Middleware.Headers, [{"Content-Type", "application/json"}]},
  {Tesla.Middleware.Timeout, timeout: 60_000}
]

adapter = {Tesla.Adapter.Finch, name: MyAppFinch}

Tesla.client(middleware, adapter)

end