Powered by Genql
GraphQL client for the
opencollective.com API
opencollective.com API
GraphQL API for Open Collective.\nOpen Collective is a legal and financial toolbox for groups.\nIt’s a fundraising + legal status + money management platform for your community.
This SDK was created from the opencollective.com GraphQL API with Genql.
This library is fully type safe and thanks to TypeScript auto completion you can discover fields and methods very easily.
How to install
Use a package manager to install the API client
bashnpm install @genql/opencollective
Using the client
Use a package manager to install the API client
typescriptimport { createClient } from '@genql/opencollective' const client = createClient()
Passing headers
You can use the headers options to pass credentials or other headers
typescriptimport { createClient } from '@genql/opencollective' const client = createClient({ headers: { Authorization: `Bearer ${Token}` } })
Example queries
This SDK is generated from the opencollective.com
GraphQL API so the client has a structure similar to the one used by GraphQL queries.
To fetch fields you need to explicitly pass field: true
, you can also pass __args
to fetch all scalar fields on a type.
Notice that to pass arguments you can use __args
typescriptimport { createClient } from '@genql/opencollective' const client = createClient() // query variables let channel let format let height = 3 let githubHandle = '' let id = '' client .query({ account: { __args: { githubHandle: githubHandle, id: id, }, activitySubscriptions: { __args: { channel: channel, }, active: true, channel: true, }, backgroundImageUrl: { __args: { format: format, height: height, }, }, categories: true, }, }) .then((x) => console.log(JSON.stringify(x, null, 4))) // query variables let format let height = 3 let country let hasCustomContributionsEnabled = false let limit = 3 let offset = 3 let tagSearchOperator client .query({ accounts: { __args: { country: country, hasCustomContributionsEnabled: hasCustomContributionsEnabled, limit: limit, offset: offset, tagSearchOperator: tagSearchOperator, }, limit: true, nodes: { backgroundImageUrl: { __args: { format: format, height: height, }, }, categories: true, }, offset: true, }, }) .then((x) => console.log(JSON.stringify(x, null, 4)))
More usage examples
This SDK was created using Genql so you can find more usage examples in the main Genql website and docs