hasura / hasura/graphql-engine
REST API: 'Run Request' fails with the error 'Failed to execute 'fetch' on 'Window': Request with GET/HEAD method cannot have body.'
- Dominant language
- TypeScript
- Stars
- 32.1k
- Forks
- 3k
- PR merge metrics
- PR metrics pending
Description
### Version Information
Server Version: Many versions (Tried in v2.6.2, 2.8.4, v2.16.1)
### Environment
Any (Tried in OSS)
### What is the current behaviour?
Trying to run a REST API that has variables that uses the HTTP GET method results in the error -

### What is the expected behaviour?
Clicking 'Run request' should work and the results should be shown.
### How to reproduce the issue?
1. Create and track the table -
```sql
CREATE TABLE author(id SERIAL PRIMARY KEY, name TEXT);
```
2. Track the following query as a REST API
```graphql
query Authors($offset: Int = 0) {
author(limit: 10, offset: $offset) {
id
name
}
}
```
3. Click on the newly created REST
API and click on 'Run request'
### Keywords
REST Run request
Contributor guide
Research direction
No files or tests are named. Reproduce the issue by tracking the provided GraphQL query as a REST API with a GET method, then trace the REST “Run request” flow in the TypeScript code. Done means the request runs successfully and displays results without the GET/HEAD body error.
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
- Mostly clear
- Newbie friendliness
- 45/100