You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have defined a Hasura action return type like this:
type MyReturnData {
id: String!
result: String!
}
As you can see that result is defined as a type String! but in our backend code which is in nestjs, we are returning result as an object. Hasura action instead of complaining of type mismatch or failing, it is return us result as an object. Even though we have clearly defined result as a string.
To clearify, what we receive back from Hasura is this:
In this case expected behavior would be one of the following things:
Either Hasura action don't return result node at all
Or hasura action returns result node as a stringify object
How to reproduce the issue?
create a Hasura action that have a return type with a variable as a string
from backend code preferably javascript backend, return result to Hasura as an object for variable which is defined as a string in Hasura action
You will notice that Hasura action return type variable which was defined as a string is returning object as it received from backend
Any possible solutions/workarounds you're aware of?
We would like to know that is this expected behavior or this is just a bug. Because if this is a bug and we implement our code based on assumption that this is expected behavior. Then in future when this bug is fixed our entire codebase will break. If this is expected behavior then even though this is not right but this will work in our use-case so we may decide to go with this solution.
Keywords
Hasura action
The text was updated successfully, but these errors were encountered:
Version Information
Server Version:
v2.35.1
Environment
Hasura console, working on docker container
What is the current behaviour?
We have defined a Hasura action return type like this:
As you can see that
result
is defined as a type String! but in our backend code which is in nestjs, we are returning result as an object. Hasura action instead of complaining of type mismatch or failing, it is return us result as an object. Even though we have clearly defined result as a string.To clearify, what we receive back from Hasura is this:
Instead of this:
What is the expected behaviour?
In this case expected behavior would be one of the following things:
How to reproduce the issue?
Any possible solutions/workarounds you're aware of?
We would like to know that is this expected behavior or this is just a bug. Because if this is a bug and we implement our code based on assumption that this is expected behavior. Then in future when this bug is fixed our entire codebase will break. If this is expected behavior then even though this is not right but this will work in our use-case so we may decide to go with this solution.
Keywords
Hasura action
The text was updated successfully, but these errors were encountered: