Hello GraphQL!
This commit is contained in:
13
lib/middleware/graphiql.js
Normal file
13
lib/middleware/graphiql.js
Normal 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
13
lib/middleware/graphql.js
Normal 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
|
||||
}
|
||||
};
|
||||
});
|
||||
};
|
Reference in New Issue
Block a user