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

Handle empty query variables #16

Open
wants to merge 1 commit into
base: defining-mutations
Choose a base branch
from

Conversation

TimothyDJewell
Copy link

@TimothyDJewell TimothyDJewell commented Jul 23, 2016

When testing the build of defining-mutations, queries no longer worked. The console revealed the error: Uncaught SyntaxError: Unexpected end of JSON input. After reviewing, this was because the default value for the query variables (the empty string) was being passed directly to JSON.parse. While looking into this, I noticed that a simple fix was introduced for this in 07a5f14 on build-schema (which I've copied here) and that master also handles this case, but in a very different way.

There is a simple workaround of just typing {} into the query variables text box, but this is a simple solution to just make it work out of the box.

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

Successfully merging this pull request may close these issues.

1 participant