You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
743 B

  1. const request = require('request-promise')
  2. const _ = require('lodash')
  3. /* global WIKI */
  4. module.exports = {
  5. Query: {
  6. async contribute() { return {} }
  7. },
  8. ContributeQuery: {
  9. async contributors(obj, args, context, info) {
  10. try {
  11. const resp = await request({
  12. method: 'POST',
  13. uri: 'https://graph.requarks.io',
  14. json: true,
  15. body: {
  16. 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',
  17. variables: {}
  18. }
  19. })
  20. return _.get(resp, 'data.sponsors.list', [])
  21. } catch (err) {
  22. WIKI.logger.warn(err)
  23. }
  24. }
  25. }
  26. }