Files
talk/graph/context.js
T
Wyatt Johnson d1621ad424 Fixed context
2017-01-23 11:57:35 -07:00

24 lines
449 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.
if (user) {
this.user = user;
}
// Create the loaders.
this.loaders = loaders(this);
// Create the mutators.
this.mutators = mutators(this);
}
}
module.exports = Context;