Closed oravecjakub closed 1 year ago
I have tried it in our tests and I always get the correct status code 400. Can you create a small project that has this error?
Thanks for looking into this. I've created an asp.net core project where the issue manifests. Nugets:
Program.cs
using HotChocolate.Execution.Options;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddGraphQLServer()
.AddApolloTracing(TracingPreference.OnDemand)
.AddQueryType<QueryType>();
var app = builder.Build();
app.UseRouting();
app.UseEndpoints(endpoints =>
{
endpoints.MapGraphQL("/graphql");
});
app.Run();
public class QueryType
{
public string GetHello(string name) => $"Hello, {name}!";
}
Result without X-Apollo-Tracing header
Result with X-Apollo-Tracing header
Source code HC5118_Repro.zip
Hope this helps
I have verified the error ... we will do a fix for 12.12.1
This one is now fixed for version 12.12.1. I have issued the build and it should be available on NuGet in the next 30 min. I will still keep this issue open until this issue is also fixed for version 13.
Thank you for the repro!
Is there an existing issue for this?
Describe the bug
Hot Chocolate returns status code 500 Internal server error instead of 400 Bad request for invalid or too complex queries when Apollo Tracing feature is enabled Always or OnDemand.
Same behavior was observed when the query exceeded the complexity limit -- 500 with Apollo Tracing, 400 without it.
According to @michaelstaib, tracing should not change the status code https://github.com/ChilliCream/hotchocolate/issues/5116#issuecomment-1145813987
Steps to reproduce
Relevant log output
No response
Additional Context?
No response
Product
Hot Chocolate
Version
12.11.0-preview.1