Files
talk/graph/context.js
T
2017-01-20 16:49:19 -07:00

22 lines
425 B
JavaScript

const loaders = require('./loaders');
const mutators = require('./mutators');
/**
* Stores the request context.
*/
class Context {
constructor({user = null}) {
// Load the current logged in user to `user`, otherwise this'll be null.
this.user = user;
// Create the loaders.
this.loaders = loaders(this);
// Create the mutators.
this.mutators = mutators(this);
}
}
module.exports = Context;