[PR #593] [MERGED] Fix variablesJSONString store default for GraphQL page #2731

Closed
opened 2026-03-17 00:24:40 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/593
Author: @dihmeetree
Created: 2/24/2020
Status: Merged
Merged: 2/24/2020
Merged by: @NBTX

Base: masterHead: patch-1


📝 Commits (1)

  • 7022ef5 Fix variables JSON string

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 store/state.js (+1 -1)

📄 Description

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)

This error is caused by Postwoman trying to JSON parse an empty string, which is set as the default.
github.com/liyasthomas/postwoman@f690ea01c4/pages/graphql.vue (L505)

Setting the variablesJSONString variable to the correct default ({}) fixes this issue :)

Before:
image

After:
image


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hoppscotch/hoppscotch/pull/593 **Author:** [@dihmeetree](https://github.com/dihmeetree) **Created:** 2/24/2020 **Status:** ✅ Merged **Merged:** 2/24/2020 **Merged by:** [@NBTX](https://github.com/NBTX) **Base:** `master` ← **Head:** `patch-1` --- ### 📝 Commits (1) - [`7022ef5`](https://github.com/hoppscotch/hoppscotch/commit/7022ef5f7ee0a96fa42ba100c95c360ffa9045aa) Fix variables JSON string ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `store/state.js` (+1 -1) </details> ### 📄 Description 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) ``` **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 `variablesJSONString` variable to the correct default (`{}`) fixes this issue :) **Before**: ![image](https://user-images.githubusercontent.com/20114263/75123381-dcdeb780-5674-11ea-8029-ee13fe5340af.png) **After**: ![image](https://user-images.githubusercontent.com/20114263/75123396-e9fba680-5674-11ea-983a-e0eaacb1cd9e.png) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 00:24:40 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#2731
No description provided.