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
l: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1]
An unhandled exception has occurred while executing the request.
System.InvalidOperationException: Invalid accept media types specified.
at HotChocolate.AspNetCore.Serialization.DefaultHttpResponseFormatter.FormatAsync(HttpResponse response, IExecutionResult result, AcceptMediaType[] acceptMediaTypes, Nullable`1 proposedStatusCode, CancellationToken cancellationToken)
at HotChocolate.AspNetCore.HttpPostMiddlewareBase.HandleRequestAsync(HttpContext context)
at HotChocolate.AspNetCore.HttpPostMiddlewareBase.HandleRequestAsync(HttpContext context)
at HotChocolate.AspNetCore.HttpPostMiddlewareBase.InvokeAsync(HttpContext context)
at Microsoft.AspNetCore.Builder.EndpointRouteBuilderExtensions.<>c__DisplayClass23_0.<b__1>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)
Additional context
Not sure if this is the root cause, but it looks like when specifying the bug directive, "operationName" is not added to the message payload.
Nitro stumbles over the directive and does not recognize it as subscription because of this. This is why it sends in the operation as a query with the accept header /
Hot Chocolate in this case will not accept it as a subscription. There was an error in the mapping logic when we inspected the accept header.
Nitro will even after a fix not expect a stream to come back. Meaning it starts buffering the request. Instead it should inspect the response content type.
Product
Nitro
Version
14.1.0
Link to minimal reproduction
https://github.com/fabianoliver/hotchocolate-bug-2024-08-11/tree/main
Steps to reproduce
Run the server & run the following query in Nitro:
What is expected?
A valid result
What is actually happening?
Returns an internal server error:
{
"message": "",
"name": "ServerError",
"statusCode": 500,
"statusText": "Internal Server Error",
"bodyText": ""
}
Relevant log output
l: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1]
An unhandled exception has occurred while executing the request.
System.InvalidOperationException: Invalid accept media types specified.
at HotChocolate.AspNetCore.Serialization.DefaultHttpResponseFormatter.FormatAsync(HttpResponse response, IExecutionResult result, AcceptMediaType[] acceptMediaTypes, Nullable`1 proposedStatusCode, CancellationToken cancellationToken)
at HotChocolate.AspNetCore.HttpPostMiddlewareBase.HandleRequestAsync(HttpContext context)
at HotChocolate.AspNetCore.HttpPostMiddlewareBase.HandleRequestAsync(HttpContext context)
at HotChocolate.AspNetCore.HttpPostMiddlewareBase.InvokeAsync(HttpContext context)
at Microsoft.AspNetCore.Builder.EndpointRouteBuilderExtensions.<>c__DisplayClass23_0.<b__1>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)
Additional context
Not sure if this is the root cause, but it looks like when specifying the bug directive, "operationName" is not added to the message payload.
Chrome network traces suggest the failing query hits http://localhost:5095/graphql with the following payload:
If you remove the "bug" directive, the following query works:
With the following payload payload
The text was updated successfully, but these errors were encountered: