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
Describe the bug
The two same queries, one with a parameter statically put in it, the other one with the same parameters passed as "Query Variables" result in two different behavior.
The first one is working fine, the second one ends up in a "Maximum call stack size exceeded" error.
To Reproduce
I don't have a codesandbox here, but investigating the issue, I narrowed down a MRE schema.graphql with a query who would trigger the issue:
Given the following schema.graphql schema definition:
"""Boolean expression to compare columns of type "uuid". All fields are combined with logical 'AND'."""typeuuid_comparison_exp {
_eq: String_neq: String
}
schema {
query: query_root
}
typequery_root {
projects: [projects!]!
}
typetasks {
id: String!
}
"""Boolean expression to filter rows from the table "tasks". All fields are combined with a logical 'AND'."""typetasks_bool_exp {
_or: [tasks_bool_exp!]
id: uuid_comparison_exp
}
typeprojects {
""" An array relationship """id: String!tasks(where: tasks_bool_exp): [tasks!]!
}
Here, as you can see, I simply filter out the recursive "_or" parameter from the "task_bool_exp" type. Doing so allow the query to execute properly. Leading me to believe the issue is probably related to the way we handle (JSONification) query variables arguments.
Expected behavior
The two queries should return the same non-errored results.
As a little more context, the API I'm meshing with is generated by Hasura so the filtering "recursive" types are automatically generated I cannot really get rid of them.
The "DEBUG" mode didn't bring a lot of intel, but there are the logs of a query failing because of this issue:
After some more digging and CPU profiling, I think I've been able to pin down the root the the issue, it comes from the graphql-jit dependency and the way they handle variables:
This is the CPU profiling I used to get to this conclusion:
Looking at graphql-jit repository it seems that an issue related is already opened on this subject:
Describe the bug
The two same queries, one with a parameter statically put in it, the other one with the same parameters passed as "Query Variables" result in two different behavior.
The first one is working fine, the second one ends up in a "Maximum call stack size exceeded" error.
To Reproduce
I don't have a codesandbox here, but investigating the issue, I narrowed down a MRE schema.graphql with a query who would trigger the issue:
Given the following schema.graphql schema definition:
This following graphql query will work:
The following graphql query will result in an Maximum call stack error:
Query variables definition:
Using
.meshrc
to transform the graphql schema like so will solve the "maximum called stack" error on the second request.Here, as you can see, I simply filter out the recursive "_or" parameter from the "task_bool_exp" type. Doing so allow the query to execute properly. Leading me to believe the issue is probably related to the way we handle (JSONification) query variables arguments.
Expected behavior
The two queries should return the same non-errored results.
Environment:
Additional context
Possibly related #1751
As a little more context, the API I'm meshing with is generated by Hasura so the filtering "recursive" types are automatically generated I cannot really get rid of them.
The "DEBUG" mode didn't bring a lot of intel, but there are the logs of a query failing because of this issue:
After some more digging and CPU profiling, I think I've been able to pin down the root the the issue, it comes from the
graphql-jit
dependency and the way they handle variables:This is the CPU profiling I used to get to this conclusion:
Looking at
graphql-jit
repository it seems that an issue related is already opened on this subject:zalando-incubator/graphql-jit#81
The text was updated successfully, but these errors were encountered: