Kong / Kong/insomnia

Error while fetching schema: Unexpected <EOF>

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

Description

### Expected Behavior

When fetching a graphql schema, I would expect Insomnia to fetch the schema correctly.

### Actual Behavior

Actually the "Refresh Schema" action produces an error:
image

This is the content of the "debug" window:

```
Preparing request to http://localhost:4000/admin/graphql
* Current time is 2022-09-16T14:29:21.329Z
* Enable automatic URL encoding
* Using default HTTP version
* Enable SSL validation
* Enable cookie sending with jar of 6 cookies
* Found bundle for host localhost: 0x7f90d0546fd0 [serially]
* Can not multiplex, even if we wanted to!
* Re-using existing connection! (#9) with host localhost
* Connected to localhost (127.0.0.1) port 4000 (#9)

> POST /admin/graphql HTTP/1.1
> Host: localhost:4000
> User-Agent: insomnia/2022.5.1
> Content-Type: application/json
> Authorization: Bearer
> Accept: */*
> Content-Length: 1811

| {"query":"\n query IntrospectionQuery {\n __schema {\n \n queryType { name }\n mutationType { name }\n subscriptionType { name }\n types {\n ...FullType\n }\n directives {\n name\n description\n \n locations\n args {\n ...InputValue\n }\n }\n }\n }\n\n fragment FullType on __Type {\n kind\n name\n description\n \n fields(includeDeprecated: true) {\n name\n description\n args {\n ...InputValue\n }\n type {\n ...TypeRef\n }\n isDeprecated\n deprecationReason\n }\n inputFields {\n ...InputValue\n }\n interfaces {\n ...TypeRef\n }\n enumValues(includeDeprecated: true) {\n name\n description\n isDeprecated\n deprecationReason\n }\n possibleTypes {\n ...TypeRef\n }\n }\n\n fragment InputValue on __InputValue {\n name\n description\n type { ...TypeRef }\n defaultValue\n \n \n }\n\n fragment TypeRef on __Type {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n }\n }\n }\n }\n }\n }\n }\n }\n ","operationName":"IntrospectionQuery"}

* Mark bundle as not supporting multiuse

< HTTP/1.1 200 OK
< cache-control: max-age=0, private, must-revalidate
< content-length: 258057
< content-type: application/json; charset=utf-8
< date: Fri, 16 Sep 2022 14:29:21 GMT
< server: Cowboy
< traceparent: 00-ab8b7be0ce0525141917a0848c17b088-5cb6370a950d3a03-01
< x-request-id: FxVdm9u-xUgQ7D8AAAGB

* Received 15.7 KB chunk
* Received 16 KB chunk
* Received 16 KB chunk
* Received 16 KB chunk
* Received 16 KB chunk
* Received 16 KB chunk
* Received 16 KB chunk
* Received 16 KB chunk
* Received 16 KB chunk
* Received 16 KB chunk
* Received 16 KB chunk
* Received 16 KB chunk
* Received 16 KB chunk
* Received 16 KB chunk
* Received 16 KB chunk
* Received 12.3 KB chunk
* Connection #9 to host localhost left intact
```

Executing the introspection query with Insomnia (as a normal query) the operation is successful.
Which could be the problem?

### Reproduction Steps

_No response_

### 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

_No response_

### Insomnia Version

2022.5.1

### What operating system are you using?

macOS

### Operating System Version

macOS Monterey

### Installation method

download from insomnia.rest

### Last Known Working Insomnia version

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the Refresh Schema action against the endpoint described in the debug log, then compare it with executing the same introspection query normally. Inspect the schema-fetching path and its handling of the 200 response and EOF error. Done means Refresh Schema imports the GraphQL schema successfully without producing the EOF error.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, typescript
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.