Skip to content

Commit 5e6605b

Browse files
authored
WriteResponseAsync virtual (#736)
1 parent cacb72f commit 5e6605b

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/Transports.AspNetCore/GraphQLHttpMiddleware.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ protected virtual Task WriteErrorResponseAsync(HttpContext context, string error
246246
return _serializer.WriteAsync(context.Response.Body, result, GetCancellationToken(context));
247247
}
248248

249-
private Task WriteResponseAsync<TResult>(HttpResponse httpResponse, IGraphQLSerializer serializer, CancellationToken cancellationToken, TResult result)
249+
protected virtual Task WriteResponseAsync<TResult>(HttpResponse httpResponse, IGraphQLSerializer serializer, CancellationToken cancellationToken, TResult result)
250250
{
251251
httpResponse.ContentType = "application/json";
252252
httpResponse.StatusCode = 200; // OK

tests/ApiApprovalTests/GraphQL.Server.Transports.AspNetCore.approved.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ namespace GraphQL.Server.Transports.AspNetCore
3636
protected virtual System.Threading.Tasks.Task RequestExecutedAsync(in GraphQL.Server.Transports.AspNetCore.GraphQLRequestExecutionResult requestExecutionResult) { }
3737
protected virtual System.Threading.Tasks.Task RequestExecutingAsync(GraphQL.Transport.GraphQLRequest request, int? indexInBatch = default) { }
3838
protected virtual System.Threading.Tasks.Task WriteErrorResponseAsync(Microsoft.AspNetCore.Http.HttpContext context, string errorMessage, System.Net.HttpStatusCode httpStatusCode) { }
39+
protected virtual System.Threading.Tasks.Task WriteResponseAsync<TResult>(Microsoft.AspNetCore.Http.HttpResponse httpResponse, GraphQL.IGraphQLSerializer serializer, System.Threading.CancellationToken cancellationToken, TResult result) { }
3940
}
4041
public readonly struct GraphQLRequestExecutionResult
4142
{

0 commit comments

Comments
 (0)