A GraphQL client for Elixir
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config Initial commit May 28, 2017
lib
logo chore(logo): Add project logo May 25, 2018
test feat(response): return a meaningful error when response is not JSON (#27 Dec 25, 2018
.formatter.exs style(elixir): Use elixir 1.6 formatter Feb 27, 2018
.gitignore Initial commit May 28, 2017
.travis.yml
CHANGELOG.md chore(version): Bump to v1.1.0 Dec 25, 2018
LICENSE.md Initial commit May 28, 2017
README.md chore(version): Bump to v1.1.0 Dec 25, 2018
mix.exs
mix.lock chore(version): Bump to v0.9.0 Sep 8, 2018

README.md

neuron

Build Status Hex Version

A GraphQL client for Elixir.

Index

Installation

def deps do
  [{:neuron, "~> 1.1.0"}]
end

Usage

iex> Neuron.Config.set(url: "https://example.com/graph")

iex> Neuron.query("""
      {
        films {
          count
        }
      }
    """)

# Response will be:

{:ok, %Neuron.Response{body: %{"data" => {"films" => { "count": 123 }}}%, status_code: 200, headers: []}}

# You can also run mutations

iex> Neuron.query("""
      mutation createUser($name: String!) {
        createUser(name: $name) {
          id
          name
        }
      }
    """,
    %{name: "uesteibar"}
    )

More extensive documentation can be found at https://hexdocs.pm/neuron.

Running locally

Clone the repository

git clone git@github.com:uesteibar/neuron.git

Install dependencies

cd neuron
mix deps.get

To run the tests

mix test

To run the lint

mix credo

Contributing

Pull requests are always welcome =)

The project uses standard-changelog to update the Changelog with each commit message and upgrade the package version. For that reason every contribution should have a title and body that follows the conventional commits standard conventions (e.g. feat(connection): Make it smarter than Jarvis).

To make this process easier, you can do the following:

Install commitizen and cz-conventional-changelog globally

npm i -g commitizen cz-conventional-changelog

Save cz-conventional-changelog as default

echo '{ "path": "cz-conventional-changelog" }' > ~/.czrc

Instead of git commit, you can now run

git cz

and follow the instructions to generate the commit message.