@classdo/classdo
v0.2.1
Published
ClassDo API client for browsers and NodeJS.
Downloads
6
Readme
classdo.js
ClassDo API client for browsers and NodeJS.
Quick Start
Install via npm
npm install @classdo/classdo
Install via yarn
yarn add @classdo/classdo
Making requests
const { ClassDoAPIClient } = require('@classdo/classdo')
const client = new ClassDoAPIClient({ accessToken: 'xxxxxxxx' })
client.viewer().then(result => {
// fetch viewer
console.log(result)
})
Interface
All request apis accept request to fetch specified fields and related object according to our GraphQLSchema.
Like below.
client.viewer.get(['id'], {
rooms: { fields: ['id', 'name'] } // request to fetch rooms also
}).then(v => {
if (v.data) {
console.log(v.data) // viewer
console.log(v.data.rooms.edges) // rooms
}
})
You can see our GraphQL schema details here.
APIs
See this document.
License
MIT