khaosdoctor / gotql

GraphQL query utility for serverside apps

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

response.statusCode should be a Number

franciscolourenco opened this issue · comments

Describe the bug
response.statusCode is a String, but it should be a Number. All the libraries I've used so far use numbers for status codes, including nodejs.
https://nodejs.org/api/http.html#http_response_statuscode

To Reproduce
Make a request with gotql.query() and examinine the statusCode property of the response.

Current behavior
typeof response.statusCode === 'string'

Expected behavior
typeof response.statusCode === 'number'

Strange, there's a test for it asserting deep equally that it's a 500, will look into it

Currently, the status code is typed as number as per the interface below:

errorStatusCode?: number,

Also, got types its responses as number and TypeScript is typing it as number:

image

And Got too:

image

I wasn't able to reproduce this error, can you please provide an example?

Can't reproduce it anymore either, thanks!