GraphQL interface to the Trello REST API
There are two ways of using this package:
- As a library for running GraphQL queries locally.
- Deploy your own Apollo-based GraphQL server e.g. to Heroku.
Install the package:
npm install @metabolize/graphql-trello
// Pass a GraphQL string or use `graphql-tag` to pass in a parsed query.
const gql = require('graphql-tag')
const queryTrello = require('../lib')
const credentials = {
trelloKey: '...',
trelloToken: '...',
}
const boardID = '...'
async function main() {
const variables = { boardId }
const { getBoard: board } = await queryTrello({
query: gql`
query($boardId: String!) {
getBoard(boardId: $boardId) {
id
name
lists {
id
name
cards {
id
name
comments {
id
content
}
}
}
members {
id
username
}
}
}
`,
variables,
...credentials,
})
console.log(JSON.stringify(board, undefined, 2))
return board
}
See the examples directory for more!
Fill this in.
Adapted from graphql-trello by Luke Horvat.
This project is licensed under the MIT License.