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

Using await on graphiql handler - Fix graphiql issues #459

Merged
merged 3 commits into from
Jul 13, 2017
Merged

Using await on graphiql handler - Fix graphiql issues #459

merged 3 commits into from
Jul 13, 2017

Conversation

bwlt
Copy link
Contributor

@bwlt bwlt commented Jul 10, 2017

This solves issue #449 without workarounds on microrouter definitions.

This is a proposal! Please review the code before merging! (It's my first experience with typescript, maybe also the README must be reviewed)
I was not able to provide tests for this use case, but the diff consists on a refactor to the graphiql handler. It use an async function so the microroute awaits the execution of the handler before responds with a 404

@apollo-cla
Copy link

@bwlt: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/

@jimthedev
Copy link
Contributor

LGTM

const query = req.url && url.parse(req.url, true).query || {};
GraphiQL.resolveGraphiQLString(query, options, req).then(graphiqlString => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think eaiser solution is just return the promise here..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahah yeah it was so simple!

@stubailo stubailo merged commit f20161b into apollographql:master Jul 13, 2017
@bwlt bwlt deleted the fix/graphiql branch July 19, 2017 12:47
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants