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
In the past few weeks we've seen two cases where the Gateway would completely error for seemingly unproblematic queries, while we were removing (in these queries unused) arguments with a default value from our subgraphs.
In the time window between the subgraph without the argument being deployed, the gateway still knowing about the argument and clients sending requests without that argument, we saw that the gateway would send the default value of the argument to the subgraph even though the argument wasn't set in the user's query.
Of course this leads to an error, since the subgraph no longer defines the argument, so the query is rejected as being invalid, even though the raw user query would execute just fine against the subgraph.
This makes it impossible to remove arguments without downtime.
Steps to reproduce
I've created this test as a reproduction:
[Fact]publicasyncTaskTest(){// arrangevarfusionGraph=awaitFusionGraphComposer.ComposeAsync(new[]{newSubgraphConfiguration("Test",""" type Query { test(arg: TestEnum = VALUE2): Boolean } enum TestEnum { VALUE1, VALUE2 } ""","",new[]{newHttpClientConfiguration(newUri("http://client"),"Test")},null)});// actvarresult=awaitCreateQueryPlanAsync(fusionGraph,""" query Test { test } """);// assertvarsnapshot=newSnapshot();snapshot.Add(result.UserRequest,nameof(result.UserRequest));snapshot.Add(result.QueryPlan,nameof(result.QueryPlan));awaitsnapshot.MatchAsync();}
If you look at the test output or rather the query plan of the { test } query, you can see that the gateway plans the following query:
queryTest_1 { test(arg: VALUE2) }
I don't see why the gateway should hardcode the default value.
Is there an existing issue for this?
Product
Hot Chocolate
Describe the bug
In the past few weeks we've seen two cases where the Gateway would completely error for seemingly unproblematic queries, while we were removing (in these queries unused) arguments with a default value from our subgraphs.
In the time window between the subgraph without the argument being deployed, the gateway still knowing about the argument and clients sending requests without that argument, we saw that the gateway would send the default value of the argument to the subgraph even though the argument wasn't set in the user's query.
Of course this leads to an error, since the subgraph no longer defines the argument, so the query is rejected as being invalid, even though the raw user query would execute just fine against the subgraph.
This makes it impossible to remove arguments without downtime.
Steps to reproduce
I've created this test as a reproduction:
If you look at the test output or rather the query plan of the
{ test }
query, you can see that the gateway plans the following query:I don't see why the gateway should hardcode the default value.
Full test output:
Relevant log output
No response
Additional Context?
No response
Version
14.0.0-p.15
The text was updated successfully, but these errors were encountered: