mirror of
https://github.com/hoppscotch/hoppscotch.git
synced 2026-04-26 09:16:03 +03:00
[GH-ISSUE #497] GraphQL String variables are null #195
Labels
No labels
CodeDay
a11y
browser limited
bug
bug fix
cli
core
critical
design
desktop
discussion
docker
documentation
duplicate
enterprise
feature
feature
fosshack
future
good first issue
hacktoberfest
help wanted
i18n
invalid
major
minor
need information
need testing
not applicable to hoppscotch
not reproducible
pull-request
question
refactor
resolved
sandbox
self-host
spam
stale
testmu
wip
wont fix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hoppscotch#195
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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:
Screenshots


Desktop
Additional context
Query performed with proxy disabled in settings
@liyasthomas commented on GitHub (Jan 17, 2020):
@AndrewBastin @pushrbx
@pushrbx commented on GitHub (Jan 17, 2020):
Assign this to me @liyasthomas please, I will do it.
@liyasthomas commented on GitHub (Jan 17, 2020):
Fine. 🚀
@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.
@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.