Search code examples
graphqlhasura

Int cannot represent non-integer value: "4"


The error obviously makes sense. We are passing strings for Int value, but this used to work just fine. This has quite big implication on our code.

Example of error:
Example of error

I also have 2 environment running with same Hasura version. On one of these this error is not occurring. As far as I know we haven't touched these environment in at least 2 months.

Hasura about info:

Hasura about info

Does anyone have a solution or any inside on the issue?


Solution

  • After some more investigating I found the culprit. It was the graphql of the remote schema not Hasura itself.

    It uses PHP Lighthouse -> webonyx/graphql and something must of changed for IntType and FloatType. I fixed it by introducing custom scalars that do accept strings.

    I assumed it was Hasura at first because the remote schema didn't receive an update in 2 months.

    I guess we just didn't noticed.