Closed KyleAMathews closed 9 years ago
couldn't you pass it through the rootValue?
Indeed you need to pass it through the rootValue using a function.
server.register({
register: GraphQL,
options: {
query: (request) => {{
schema: TestSchema,
// the rootValue will be available in every `resolve` in your schema
// see graphql doc for more informations
rootValue: {
db: request.server.app.db, // or request.server.plugins.db or ...
viewer: request.auth.credentials
}
}),
route: {
path: '/graphql',
config: {}
}
}
}, () =>
server.start(() =>
console.log('Server running at:', server.info.uri)
)
);
Not sure how I can access them with how you've set things up atm...