Kong / Kong/insomnia

[Bug] GraphQL Query variables, are market as not appear in any GraphQL query, but they are!

Open
#1,902 15 comments 9 reactions 0 assignees View on GitHub
A-graphql needs-triage
Dominant language
TypeScript
Stars
40k
Forks
2.4k
Avg merge
2d 13h
Merged PRs (30d)
61

Description

Insomnia Version: 7.0.3
Operating System: Windows 10 x64

**Describe the bug**
When access stored graphql request, all `Query variables` are marked as not appear in any graphql query. But they are, because were used before and stored in a request.

**To Reproduce**

1. Create a new GraphQL request with some variables
2. Run query, it need to work with variables.
3. Now, close insomnia or go to another query
4. Return to request created before, and check the variables. You will see all variables marked as invalid
5. Just retype the same variable name, and all variables will works again

**Expected behavior**
As the stored request has valid query variables, so the query works fine. BUT... all queries are marked as invalid

**Screenshots**
![image](https://user-images.githubusercontent.com/2028673/72750954-03549300-3b9d-11ea-9969-8ff54179d00e.png)

**Desktop (please complete the following information):**
- OS: Windows 10 64 bits
- Installation Method: Windows installer
- App Version: 7.0.3

**Additional context**
Everything works... just the variables are marked as does not appear in any query. But if you check in my screenshot, the `updatePost` query contains the variables, none of them are missing.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with a stored GraphQL request in Insomnia 7.0.3 using the listed steps, then inspect the code responsible for restoring requests and validating query variables. Done means previously stored variables are recognized as used after reopening or switching requests, without requiring them to be retyped.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, typescript
Domain
api, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.