2018-09-22 15:27:48 +00:00
|
|
|
const request = require('request-promise')
|
|
|
|
const _ = require('lodash')
|
|
|
|
|
2020-01-18 20:18:41 +00:00
|
|
|
/* global WIKI */
|
|
|
|
|
2018-09-22 15:27:48 +00:00
|
|
|
module.exports = {
|
|
|
|
Query: {
|
|
|
|
async contribute() { return {} }
|
|
|
|
},
|
|
|
|
ContributeQuery: {
|
|
|
|
async contributors(obj, args, context, info) {
|
2020-01-18 20:18:41 +00:00
|
|
|
try {
|
|
|
|
const resp = await request({
|
|
|
|
method: 'POST',
|
|
|
|
uri: 'https://graph.requarks.io',
|
|
|
|
json: true,
|
|
|
|
body: {
|
|
|
|
query: '{\n sponsors {\n list(kind: BACKER) {\n id\n source\n name\n joined\n website\n twitter\n avatar\n }\n }\n}\n',
|
|
|
|
variables: {}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
return _.get(resp, 'data.sponsors.list', [])
|
|
|
|
} catch (err) {
|
|
|
|
WIKI.logger.warn(err)
|
|
|
|
}
|
2018-09-22 15:27:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|