Skip to content

Sed9yDataBank/ex_linear

Repository files navigation

ExLinear

A Linear GraphQL client for Elixir. Fetch issues, run custom queries, and plug in your own config.


Linear

Installation

Add to your mix.exs:

def deps do
  [
    {:ex_linear, "~> 0.1.0"}
  ]
end

Then run mix deps.get.

Configuration

Build config from options or from application config:

# From options
config = ExLinear.Config.from_opts(
  api_key: System.get_env("LINEAR_API_KEY"),
  project_slug: "ENG",
  active_states: ["Todo", "In Progress"],
  assignee: "me"  # optional
)

# Or from application config (config.exs / runtime.exs)
config = ExLinear.Config.from_application()

In config/runtime.exs (or config.exs):

config :ex_linear,
  api_key: System.get_env("LINEAR_API_KEY"),
  project_slug: "ENG",
  active_states: ["Todo", "In Progress"]

Usage

Fetch issues for your project and states (with optional assignee filter):

config = ExLinear.Config.from_opts(api_key: "...", project_slug: "ENG", active_states: ["Todo", "In Progress"])

{:ok, issues} = ExLinear.Client.fetch_candidate_issues(config)
# => list of %ExLinear.Issue{}

Run any GraphQL query or mutation:

{:ok, body} = ExLinear.Client.graphql(config, "query { viewer { id } }", %{})

License

Apache 2.0

About

just a lightweight Linear graphql api client in elixir.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages