Interface IServerDiagnosticEvents
- Namespace
- HotChocolate.AspNetCore.Instrumentation
- Assembly
- HotChocolate.AspNetCore.dll
The diagnostic events of the GraphQL transport layer.
public interface IServerDiagnosticEvents
Methods
ExecuteHttpRequest(HttpContext, HttpRequestKind)
Called when starting to execute a GraphQL over HTTP request in the transport layer.
IDisposable ExecuteHttpRequest(HttpContext context, HttpRequestKind kind)
Parameters
contextHttpContextThe HttpContext.
kindHttpRequestKindThe HTTP request kind that is being executed.
Returns
- IDisposable
A scope that will be disposed when the execution has finished.
FormatHttpResponse(HttpContext, IQueryResult)
Called when starting to format a GraphQL query result.
IDisposable FormatHttpResponse(HttpContext context, IQueryResult result)
Parameters
contextHttpContextThe HttpContext.
resultIQueryResultThe query result.
Returns
- IDisposable
A scope that will be disposed when GraphQL query result is written to the response stream.
HttpRequestError(HttpContext, IError)
Called within the ExecuteHttpRequest(HttpContext, HttpRequestKind) scope and signals that a error occurred while processing the GraphQL over HTTP request.
void HttpRequestError(HttpContext context, IError error)
Parameters
contextHttpContextThe HttpContext.
errorIErrorThe error.
HttpRequestError(HttpContext, Exception)
Called within the ExecuteHttpRequest(HttpContext, HttpRequestKind) scope and signals that a error occurred while processing the GraphQL over HTTP request.
void HttpRequestError(HttpContext context, Exception exception)
Parameters
contextHttpContextThe HttpContext.
exceptionExceptionThe Exception.
ParseHttpRequest(HttpContext)
Called when starting to parse a GraphQL HTTP request.
IDisposable ParseHttpRequest(HttpContext context)
Parameters
contextHttpContextThe HttpContext.
Returns
- IDisposable
A scope that will be disposed when the parsing is completed.
ParserErrors(HttpContext, IReadOnlyList<IError>)
Called within the ParseHttpRequest(HttpContext) scope and signals that a error occurred while parsing the GraphQL request.
void ParserErrors(HttpContext context, IReadOnlyList<IError> errors)
Parameters
contextHttpContextThe HttpContext.
errorsIReadOnlyList<IError>The errors.
StartBatchRequest(HttpContext, IReadOnlyList<GraphQLRequest>)
Called within the ExecuteHttpRequest(HttpContext, HttpRequestKind) scope and signals that a GraphQL batch request will be executed.
void StartBatchRequest(HttpContext context, IReadOnlyList<GraphQLRequest> batch)
Parameters
contextHttpContextThe HttpContext.
batchIReadOnlyList<GraphQLRequest>A list of GraphQL requests that represents the batch.
StartOperationBatchRequest(HttpContext, GraphQLRequest, IReadOnlyList<string>)
Called within the ExecuteHttpRequest(HttpContext, HttpRequestKind) scope and signals that a GraphQL batch request will be executed.
void StartOperationBatchRequest(HttpContext context, GraphQLRequest request, IReadOnlyList<string> operations)
Parameters
contextHttpContextThe HttpContext.
requestGraphQLRequestA GraphQL request with multiple operations in a single GraphQL document.
operationsIReadOnlyList<string>A list of operation names that represents the execution order of the operations within the GraphQL document.
StartSingleRequest(HttpContext, GraphQLRequest)
Called within the ExecuteHttpRequest(HttpContext, HttpRequestKind) scope and signals that a single GraphQL request will be executed.
void StartSingleRequest(HttpContext context, GraphQLRequest request)
Parameters
contextHttpContextThe HttpContext.
requestGraphQLRequestThe parsed GraphQL request.
WebSocketSession(HttpContext)
Called when starting to establish a GraphQL WebSocket session.
IDisposable WebSocketSession(HttpContext context)
Parameters
contextHttpContextThe HttpContext.
Returns
- IDisposable
A scope that will enclose the whole WebSocket session and is disposed when the session is closed.
WebSocketSessionError(HttpContext, Exception)
Called within the WebSocketSession(HttpContext) scope and signals that a error occurred that terminated the session.
void WebSocketSessionError(HttpContext context, Exception exception)
Parameters
contextHttpContextThe HttpContext.
exceptionException