Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we drop this repo in favor of @gramps/gramps? #46

Open
jlengstorf opened this issue Nov 6, 2017 · 0 comments
Open

Can we drop this repo in favor of @gramps/gramps? #46

jlengstorf opened this issue Nov 6, 2017 · 0 comments
Labels

Comments

@jlengstorf
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant