int cannot represent non 32-bit signed integer value error when using timestamp/big numbers #3142
Replies: 3 comments 1 reply
-
Could you share how that parameter/field defined in the schema? |
Beta Was this translation helpful? Give feedback.
-
@ardatan the service that exposes the APIs is written in python. when I use int type for the params, the parameters in swagger schema look like that:
and I get the "GraphQLError: Int cannot represent non 32-bit signed integer value" error when I try to pass timestamp like: 1638538087000 when I change the pyhton code from int to float it's working, and the swagger schema looks like that:
from the python service, it's wrong to declare the timestamp as float cause it's actually an integer and not float. so it's not a good workaround. Thanks! |
Beta Was this translation helpful? Give feedback.
-
I have the same problem. .meshrc.yaml - type: Query
field: dauMediaDailyReqTotal
path: /dau/media/daily/reqtotal
queryParamArgMap:
from: from
to: to
argTypeMap:
from:
type: string
nullable: true
to:
type: string
nullable: true
method: GET
responseSample: ./samples/dauMediaDailyReqTotal.response.json
responseTypeName: DauMediaDailyReqTotal ./samples/dauMediaDailyReqTotal.response.json file [
{
"appId": "10384",
"date": "2023-05-11",
"total": 16946047
}
] then get error like this: |
Beta Was this translation helpful? Give feedback.
-
Hi,
I used graphql-mesh to connect to openapi swagger rest endpoints.
There are a few endpoints that get parameters of timestamps and also return timestamp as an int.
In the graphql UI, I get this error:
"int cannot represent non 32-bit signed integer value"
for example:
"GraphQLError: Int cannot represent non 32-bit signed integer value: 1638538087000"
I was able to change the types of the variables in the service that expose the swagger docs to float instead of int (python) but
I don't think it's a good solution., especially that sometimes I don't control the service that exposes the APIs.
How can I solve it?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions