View Source GQL (gql v0.5.1)

Simple GraphQL client.

Link to this section Summary

Functions

Like query/2, except raises GQL.GraphQLError if the server returns errors.

Queries a GraphQL endpoint. Returns {:ok, body, headers} upon success or {:error, body, headers} if the response contains an "errors" key.

Link to this section Functions

Like query/2, except raises GQL.GraphQLError if the server returns errors.

Queries a GraphQL endpoint. Returns {:ok, body, headers} upon success or {:error, body, headers} if the response contains an "errors" key.

An exception will be raised for exceptional errors:

options

Options

  • :headers - HTTP headers to include. The default value is [].

  • :http_options - Options to be passed to Finch.request/3. The default value is [receive_timeout: 30000].

  • :variables - Keyword list or map of variables. The default value is [].

  • :url - Required. URL to which the request is made.