0.0.3 • Published 6 years ago

graphql-trello v0.0.3

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

graphql-trello NPM version

GraphQL interface to Trello's API.

Installation

Install the package with NPM:

$ npm install graphql-trello

Usage

Example:

import graphqlTrello from "graphql-trello";

let query = `
  query($boardId: String!) {
    getBoard(boardId: $boardId) {
      id
      name
      lists {
        id
        name
        cards {
          id
          name
          comments {
            id
            content
          }
        }
      }
      members {
        id
        username
      }
    }
  }
`;

graphqlTrello({
  query,
  variables: { boardId: "TRELLO_BOARD_ID" },
  key: "TRELLO_KEY",
  token: "TRELLO_TOKEN",
}).then(data => {
  let board = data.getBoard;
  console.log(board);
}).catch(error => {
  console.error(error);
});

See the examples directory for more!

Related

Check out my other Trello packages: