Closed leandrodantediaz closed 2 months ago
This issue should probably be asked of HotChocolate instead. cc @michaelstaib
With HC 13 we return a 500 whenever all fields have been erased due to non-null propagation. We have changed this behavior with HC 14 to return a 200 in these cases. Be aware that GraphQL validation and parsing errors still will yield to a 4xx. You can override this behavior in both versions with a request middleware. Connect with the community on slack.chillicream.com or on the GraphQL discord.
I have a graphl API with .NET 6. The problem is that whenever there is an error it returns 500 and not 200. This is my server:
builder.Services.AddGraphQLServer() .RegisterDbContext(DbContextKind.Pooled)
.AddQueryType()
.AddMutationType()
.AddUploadType()
.AddFiltering()
.AddSorting()
.AddAuthorization()
.AddProjections()
.AddErrorFilter()
.SetPagingOptions(new PagingOptions { MaxPageSize = 100 })
.SetRequestOptions(_ => new HotChocolate.Execution.Options.RequestExecutorOptions { ExecutionTimeout = TimeSpan.FromMinutes(10) });
What could I be doing wrong?