Table of Contents

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

context HttpContext

The HttpContext.

kind HttpRequestKind

The 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

context HttpContext

The HttpContext.

result IQueryResult

The 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

context HttpContext

The HttpContext.

error IError

The 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

context HttpContext

The HttpContext.

exception Exception

The Exception.

ParseHttpRequest(HttpContext)

Called when starting to parse a GraphQL HTTP request.

IDisposable ParseHttpRequest(HttpContext context)

Parameters

context HttpContext

The 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

context HttpContext

The HttpContext.

errors IReadOnlyList<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

context HttpContext

The HttpContext.

batch IReadOnlyList<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

context HttpContext

The HttpContext.

request GraphQLRequest

A GraphQL request with multiple operations in a single GraphQL document.

operations IReadOnlyList<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

context HttpContext

The HttpContext.

request GraphQLRequest

The parsed GraphQL request.

WebSocketSession(HttpContext)

Called when starting to establish a GraphQL WebSocket session.

IDisposable WebSocketSession(HttpContext context)

Parameters

context HttpContext

The 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

context HttpContext

The HttpContext.

exception Exception