Kong / Kong/insomnia

Prompts don't accept empty input

Open
#5,568 1 comment 2 reactions 0 assignees View on GitHub
A-graphql B-bug B-graphql-2022.7.0 S-unverified
Dominant language
TypeScript
Stars
40k
Forks
2.4k
Avg merge
2d 13h
Merged PRs (30d)
61

Description

### Expected Behavior

Adding a variable Prompt to a GraphQL input should accept empty input and submit an empty string on the request

### Actual Behavior

![image](https://user-images.githubusercontent.com/692443/208884719-2826914e-caf5-4daa-ad72-34002d73282f.png)

### Reproduction Steps

1. Create a request with a body
2. Add a Prompt for a property of that body
3. Submit the request
4. When the Prompt modal pops up, just press to submit an empty body

### Is there an existing issue for this?

- [X] I have searched the [issue tracker](https://www.github.com/Kong/insomnia/issues) for this problem.

### Additional Information

Here's a partial export of the request I'm using

```yaml
- _id: req_806b6bb6924c46c29d6d4a7b55dc4dff
url: https://api.{{BASE_DOMAIN}}/graphql
name: ProductTypes (Query)
method: POST
body:
mimeType: application/graphql
text: "{\"query\":\"query ProductTypes($query: String!)
{\\n productTypes(query: $query)\\n}\",\"variables\":{\"query\":\"{%
prompt 'Query', 'Query', '', '', false, true
%}\"},\"operationName\":\"ProductTypes\"}"
parameters: []
headers:
- name: Authorization
value: Bearer {{ _.AUTH0_TOKEN }}
description: ""
id: pair_9779577bf901434299ac51a2aad8ff3f
- name: Content-Type
value: application/json
id: pair_32a853f454b242f1878703e7ccd19cff
```

### Insomnia Version

2022.7.0

### What operating system are you using?

Other Linux

### Operating System Version

Linux x64 5.15.81-1-MANJARO

### Installation method

pamac

### Last Known Working Insomnia version

2022.6.0

Contributor guide

Open the contributing guide

Research direction

Start at the prompt modal used while building a GraphQL request, then trace how its submitted value is inserted into the request body. Reproduce the issue by pressing Enter with an empty prompt and verify that the resulting request sends an empty string rather than rejecting the input.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, typescript
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.