Hello GraphQL!

This commit is contained in:
Zalmoxisus
2016-11-12 16:21:41 +02:00
parent 1ba4d1e40b
commit 386d9abfaf
7 changed files with 123 additions and 0 deletions

View File

@ -0,0 +1,13 @@
var graphiqlExpress = require('apollo-server').graphiqlExpress;
module.exports = graphiqlExpress({
endpointURL: '/graphql',
query:
'{\n' +
' reports {\n' +
' id,\n' +
' type,\n' +
' title\n' +
' }\n' +
'}'
});

13
lib/middleware/graphql.js Normal file
View File

@ -0,0 +1,13 @@
var apolloExpress = require('apollo-server').apolloExpress;
var schema = require('../api/schema');
module.exports = function (store) {
return apolloExpress(function() {
return {
schema: schema,
context: {
store: store
}
};
});
};