Skip to content

Instantly share code, notes, and snippets.

@mxstbr
Created February 20, 2018 10:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mxstbr/d9bece1c74cd9d02e1e6c99c8df86d69 to your computer and use it in GitHub Desktop.
Save mxstbr/d9bece1c74cd9d02e1e6c99c8df86d69 to your computer and use it in GitHub Desktop.
app.use('/api', graphqlServer((req, res) => {
const query = req.query.query || req.body.query;
// TODO: Get whitelist somehow
if (!whitelist[query]) {
throw new Error('Query is not in whitelist.');
}
/* ... */
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment