GQL

PackageDocumentationCI

Simple GraphQL client for Elixir.

Installation

The package can be installed by adding gql to your list of dependencies in mix.exs:

def deps do
  [
    {:gql, "~> 0.6.0"}
  ]
end

Usage

url = "https://api.spacex.land/graphql/"

# List SpaceX launches
GQL.query("query Launches { launches { id } }", url: url)

# Get SpaceX launch by ID
GQL.query("query Launch($launch_id: ID!) { launch(id: $launch_id) { details } }",
  url: url,
  variables: [launch_id: "9"]
)

See GQL docs for details.

Fragments

This library does not support GraphQL fragments. I'm open to pull-requests but this is not something that is a priority to me.

Alternatives

Please submit an issue or pull-request if you know of any other GraphQL client libraries for Elixir.

absinthe_client

The README indicates this project is not ready for use and it hasn't seen commits since 2019.

neuron

Neuron is a great library and I have successfully used it in production. But there are a few issues that have lead me to create GQL instead: