In looking at the various Apollo server implementations, the config object (GraphQLOptions) appears to be the same in all situations.
We need to test that, but if that's true, there's really no need to use this middleware. Instead, the API can be simplified in a universally applicable way to:
import gramps from '@gramps/gramps';
const getGraphQLOptions = gramps({ dataSources: [] });
In Express/Connect, we would use:
app.use('/graphql', bodyParser.json());
app.use('/graphql', graphqlConnect(getGraphQLOptions));
In Hapi:
server.register({
register: graphqlHapi,
options: {
path: '/graphql',
graphqlOptions: getGraphQLOptions,
},
});
Koa:
app.use(koaBody());
router.post('/graphql', graphqlKoa(getGraphQLOptions));
app.use(router.routes());
Once @gramps/gramps hits a stable release, let's look at deprecating this repo altogether.
In looking at the various Apollo server implementations, the config object (
GraphQLOptions) appears to be the same in all situations.We need to test that, but if that's true, there's really no need to use this middleware. Instead, the API can be simplified in a universally applicable way to:
In Express/Connect, we would use:
In Hapi:
Koa:
Once
@gramps/grampshits a stable release, let's look at deprecating this repo altogether.