Fix variablesJSONString store default for GraphQL page#593
Merged
NBTX merged 1 commit intohoppscotch:masterfrom Feb 24, 2020
dihmeetree:patch-1
Merged
Fix variablesJSONString store default for GraphQL page#593NBTX merged 1 commit intohoppscotch:masterfrom dihmeetree:patch-1
NBTX merged 1 commit intohoppscotch:masterfrom
dihmeetree:patch-1
Conversation
I don't have any variables set, and when running a mutation; I get the following error:
```
Error SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at VueComponent._callee$ (graphql.vue?f047:505)
at tryCatch (runtime.js?96cf:45)
at Generator.invoke [as _invoke] (runtime.js?96cf:271)
at Generator.prototype.<computed> [as next] (runtime.js?96cf:97)
at asyncGeneratorStep (asyncToGenerator.js?1da1:3)
at _next (asyncToGenerator.js?1da1:25)
at eval (asyncToGenerator.js?1da1:32)
at new Promise (<anonymous>)
at VueComponent.eval (asyncToGenerator.js?1da1:21)
```
Setting the `variablesJSONString` variable to the correct default (`{}`) fixes this issue :)
|
💬 This comment has been generated by the DeepCode bot, installed by the owner of the repository. The DeepCode bot protects your repository by detecting and commenting on security vulnerabilities or other critical issues. |
NBTX
approved these changes
Feb 24, 2020
|
Hey @dmitryyankowski, TravisBuddy Request Identifier: d1c196b0-56a1-11ea-8ad8-19cca21d7143 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I don't have any variables set, and when running a mutation; I get the following error:
This error is caused by Postwoman trying to JSON parse an empty string, which is set as the default.
https://github.com/liyasthomas/postwoman/blob/f690ea01c4319d57ea311261c9857faf4a8f6baa/pages/graphql.vue#L505
Setting the
variablesJSONStringvariable to the correct default ({}) fixes this issue :)Before:

After:
