Files
talk/graph/index.js
T
2018-01-11 20:00:34 -07:00

21 lines
615 B
JavaScript

const schema = require('./schema');
const Context = require('./context');
const { createSubscriptionManager } = require('./subscriptions');
const { ENABLE_TRACING } = require('../config');
module.exports = {
createGraphOptions: req => ({
// Schema is created already, so just include it.
schema,
// Load in the new context here, this'll create the loaders + mutators for
// the lifespan of this request.
context: new Context(req),
// Tracing request options, needed for Apollo Engine.
tracing: ENABLE_TRACING,
cacheControl: ENABLE_TRACING,
}),
createSubscriptionManager,
};