[GH-ISSUE #497] GraphQL String variables are null #195

Closed
opened 2026-03-16 13:58:56 +03:00 by kerem · 5 comments
Owner

Originally created by @bednam on GitHub (Jan 17, 2020).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/497

Originally assigned to: @pushrbx on GitHub.

Describe the bug
String variables provided for GraphQL query have null values.
Besides unquoted input I also tried to wrap String variable value with double and single quotes but result was the same.

To Reproduce
Steps to reproduce the behavior:

  1. Go to /graphql
  2. Provide GraphQL query
  3. Provide variables (including String type variable)
  4. Click "Run Query"
  5. See null variables values in request preview in console

Screenshots
Screen Shot 2020-01-17 at 11 10 41
Screen Shot 2020-01-17 at 11 11 22

Desktop

  • OS: macOS
  • Browser: chrome
  • Version 79.0.3945.88 (Official Build) (64-bit)

Additional context
Query performed with proxy disabled in settings

Originally created by @bednam on GitHub (Jan 17, 2020). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/497 Originally assigned to: @pushrbx on GitHub. **Describe the bug** String variables provided for GraphQL query have null values. Besides unquoted input I also tried to wrap String variable value with double and single quotes but result was the same. **To Reproduce** Steps to reproduce the behavior: 1. Go to /graphql 2. Provide GraphQL query 3. Provide variables (including String type variable) 4. Click "Run Query" 5. See null variables values in request preview in console **Screenshots** ![Screen Shot 2020-01-17 at 11 10 41](https://user-images.githubusercontent.com/23276452/72603819-09870d00-391a-11ea-840e-9dcefec9ecd5.png) ![Screen Shot 2020-01-17 at 11 11 22](https://user-images.githubusercontent.com/23276452/72603871-27547200-391a-11ea-8985-c9166fb7542e.png) **Desktop** - OS: macOS - Browser: chrome - Version 79.0.3945.88 (Official Build) (64-bit) **Additional context** Query performed with proxy disabled in settings
kerem 2026-03-16 13:58:56 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@liyasthomas commented on GitHub (Jan 17, 2020):

@AndrewBastin @pushrbx

<!-- gh-comment-id:575568323 --> @liyasthomas commented on GitHub (Jan 17, 2020): @AndrewBastin @pushrbx
Author
Owner

@pushrbx commented on GitHub (Jan 17, 2020):

Assign this to me @liyasthomas please, I will do it.

<!-- gh-comment-id:575581930 --> @pushrbx commented on GitHub (Jan 17, 2020): Assign this to me @liyasthomas please, I will do it.
Author
Owner

@liyasthomas commented on GitHub (Jan 17, 2020):

Fine. 🚀

<!-- gh-comment-id:575582306 --> @liyasthomas commented on GitHub (Jan 17, 2020): Fine. 🚀
Author
Owner

@AndrewBastin commented on GitHub (Jan 17, 2020):

Actually, me being busy with cross platform biz, I couldn't catch up on GraphQL updates.

Not gonna sugar coat this, the current implementation for variables sucks. I honestly can't believe I let it go through.

Variables in GraphQL may not be just some simple values, but can also be complex nested objects (facilitated through stuff like Input types)

The best approach to handling variables is either by providing a JSON editor which is parsed into a JS object when the query is ran and then injecting the objects, or by making the current variable editor type sensitive and allowing stuff like nesting.

<!-- gh-comment-id:575724712 --> @AndrewBastin commented on GitHub (Jan 17, 2020): Actually, me being busy with cross platform biz, I couldn't catch up on GraphQL updates. Not gonna sugar coat this, the current implementation for variables sucks. I honestly can't believe I let it go through. Variables in GraphQL may not be just some simple values, but can also be complex nested objects (facilitated through stuff like [Input](https://graphql.org/graphql-js/mutations-and-input-types/) types) The best approach to handling variables is either by providing a JSON editor which is parsed into a JS object when the query is ran and then injecting the objects, or by making the current variable editor type sensitive and allowing stuff like nesting.
Author
Owner

@pushrbx commented on GitHub (Jan 17, 2020):

@AndrewBastin Initially when I added this feature I thought I'd add apollo-client as dependency, because it gives you proper errors for invalid variables, and it has type checking. However it seemed too much effort because a major refactor would be required. God bless laziness.

<!-- gh-comment-id:575790318 --> @pushrbx commented on GitHub (Jan 17, 2020): @AndrewBastin Initially when I added this feature I thought I'd add apollo-client as dependency, because it gives you proper errors for invalid variables, and it has type checking. However it seemed too much effort because a major refactor would be required. God bless laziness.
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#195
No description provided.