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
The application has minimal code to reproduce the issue. It has Metrics Request Middleware which is registered in the pipeline:
usingHotChocolate.Execution;namespaceMiddlewareTest.Middleware{publicclassMetricsMiddleware{privatereadonlyHotChocolate.Execution.RequestDelegate_next;publicMetricsMiddleware(HotChocolate.Execution.RequestDelegatenext){_next=next;}publicasyncTaskInvokeAsync(IRequestContextcontext){// Do somethingawait_next(context);// Do something}}}
Build and run the application. In Nitro, build a query and run.
What is expected?
It is expected to return the response.
What is actually happening?
It is returning an error message:
{
"errors": [
{
"message": "Unexpected Execution Error",
"extensions": {
"message": "Operation is not valid due to the current state of the object.",
"stackTrace": " at HotChocolate.Execution.RequestExecutor.ExecuteAsync(IOperationRequest request, Boolean scopeDataLoader, Nullable`1 requestIndex, CancellationToken cancellationToken)\r\n at HotChocolate.Execution.RequestExecutor.ExecuteAsync(IOperationRequest request, Boolean scopeDataLoader, Nullable`1 requestIndex, CancellationToken cancellationToken)\r\n at HotChocolate.AspNetCore.MiddlewareBase.ExecuteSingleAsync(HttpContext context, IRequestExecutor requestExecutor, IHttpRequestInterceptor requestInterceptor, IServerDiagnosticEvents diagnosticEvents, GraphQLRequest request, GraphQLRequestFlags flags)\r\n at HotChocolate.AspNetCore.HttpPostMiddlewareBase.HandleRequestAsync(HttpContext context)"
}
}
]
}
Relevant log output
at HotChocolate.Execution.RequestExecutor.ExecuteAsync(IOperationRequest request, Boolean scopeDataLoader, Nullable`1 requestIndex, CancellationToken cancellationToken)\r\n at HotChocolate.Execution.RequestExecutor.ExecuteAsync(IOperationRequest request, Boolean scopeDataLoader, Nullable`1 requestIndex, CancellationToken cancellationToken)\r\n at HotChocolate.AspNetCore.MiddlewareBase.ExecuteSingleAsync(HttpContext context, IRequestExecutor requestExecutor, IHttpRequestInterceptor requestInterceptor, IServerDiagnosticEvents diagnosticEvents, GraphQLRequest request, GraphQLRequestFlags flags)\r\n at HotChocolate.AspNetCore.HttpPostMiddlewareBase.HandleRequestAsync(HttpContext context)
Additional context
I have created a Middleware that I want to run in the request pipeline. When I remove the Request Middleware, the application runs as expected. When I add it back, it results in an error.
The text was updated successfully, but these errors were encountered:
hello,
using UseDefaultPipeline(), breaks the cost analyzer , because the cost analyzer middleware is not part of the default pipeline
using .UseDefaultPipeline() .UseCostAnalyzer()
looks it works, but UseCostAnalyzer replaces the pipeline again .. can some point me to some documentation or explain how it should work ?
Product
Hot Chocolate
Version
14.3.0
Link to minimal reproduction
https://github.com/khode-hub/psychic-chainsaw
Steps to reproduce
The application has minimal code to reproduce the issue. It has Metrics Request Middleware which is registered in the pipeline:
Build and run the application. In Nitro, build a query and run.
What is expected?
It is expected to return the response.
What is actually happening?
It is returning an error message:
Relevant log output
at HotChocolate.Execution.RequestExecutor.ExecuteAsync(IOperationRequest request, Boolean scopeDataLoader, Nullable`1 requestIndex, CancellationToken cancellationToken)\r\n at HotChocolate.Execution.RequestExecutor.ExecuteAsync(IOperationRequest request, Boolean scopeDataLoader, Nullable`1 requestIndex, CancellationToken cancellationToken)\r\n at HotChocolate.AspNetCore.MiddlewareBase.ExecuteSingleAsync(HttpContext context, IRequestExecutor requestExecutor, IHttpRequestInterceptor requestInterceptor, IServerDiagnosticEvents diagnosticEvents, GraphQLRequest request, GraphQLRequestFlags flags)\r\n at HotChocolate.AspNetCore.HttpPostMiddlewareBase.HandleRequestAsync(HttpContext context)
Additional context
I have created a Middleware that I want to run in the request pipeline. When I remove the Request Middleware, the application runs as expected. When I add it back, it results in an error.
The text was updated successfully, but these errors were encountered: