context.js 300 B

12345678910111213
  1. const { db } = require('./util/db')
  2. const pubsub = require('./pubsub')
  3. const cwd = require('./connectors/cwd')
  4. // Context passed to all resolvers (third argument)
  5. // eslint-disable-next-line no-unused-vars
  6. module.exports = ({ req } = {}) => {
  7. return {
  8. db,
  9. pubsub,
  10. cwd: cwd.get()
  11. }
  12. }