@linear/sdk
Linear API SDK
Last updated a year ago by jorilallo .
MIT · Original npm · Tarball · package.json
$ cnpm install @linear/sdk 
SYNC missed versions from official npm registry.

@linear/sdk

Node library for querying Linear's API and creating new issues and tasks. It's a light wrapper around Linear's GraphQL API and ships with Typescript types out of the box.

Usage

yarn install @linear/sdk
import { Linear } from "@linear/sdk";

const linear = new Linear({
  token: "<your developer key>"
});

// Making a query
const projects = await linear.query.projects();

// Creating a new issue through mutation with return value
const newIssue = await linear.mutation.issueCreate(
  {
    input: {
      projectId: projects[0].id,
      title: "Serious bug"
    }
  },
  `
{
  issue {
    id
  }
}
`
);

If you want to be more specific on return values with your queries, you can also pass GraphQL query with the query call:

// Get project id for an issue
const issue = await linear.getIssue(issueId, "{ id project { id } }");
console.log(issue.project.id);

// Fetch project states with associated projects ids
const states = await linear.client.query.projectStates(
  {},
  `{ id name project { id } }`
);

Documentation

License

MIT

Current Tags

  • 0.0.3                                ...           latest (a year ago)

3 Versions

  • 0.0.3                                ...           a year ago
  • 0.0.2                                ...           a year ago
  • 0.0.1                                ...           a year ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 0
Dependencies (9)
Dev Dependencies (5)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |