Skip to content

Commit cb1b8e1

Browse files
authored
Pass RequestDelegate to HandleRequestAsync (#737)
1 parent 5e6605b commit cb1b8e1

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Transports.AspNetCore/GraphQLHttpMiddleware.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,12 @@ public async Task InvokeAsync(HttpContext context, RequestDelegate next)
146146
: await userContextBuilder.BuildUserContext(context);
147147

148148
var executer = context.RequestServices.GetRequiredService<IGraphQLExecuter<TSchema>>();
149-
await HandleRequestAsync(context, userContext, bodyGQLBatchRequest, gqlRequest, executer, cancellationToken);
149+
await HandleRequestAsync(context, next, userContext, bodyGQLBatchRequest, gqlRequest, executer, cancellationToken);
150150
}
151151

152152
protected virtual async Task HandleRequestAsync(
153153
HttpContext context,
154+
RequestDelegate next,
154155
IDictionary<string, object> userContext,
155156
GraphQLRequest[] bodyGQLBatchRequest,
156157
GraphQLRequest gqlRequest,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ namespace GraphQL.Server.Transports.AspNetCore
3131
protected virtual System.Threading.Tasks.Task HandleInvalidContentTypeErrorAsync(Microsoft.AspNetCore.Http.HttpContext context) { }
3232
protected virtual System.Threading.Tasks.Task HandleInvalidHttpMethodErrorAsync(Microsoft.AspNetCore.Http.HttpContext context) { }
3333
protected virtual System.Threading.Tasks.Task HandleNoQueryErrorAsync(Microsoft.AspNetCore.Http.HttpContext context) { }
34-
protected virtual System.Threading.Tasks.Task HandleRequestAsync(Microsoft.AspNetCore.Http.HttpContext context, System.Collections.Generic.IDictionary<string, object> userContext, GraphQL.Transport.GraphQLRequest[] bodyGQLBatchRequest, GraphQL.Transport.GraphQLRequest gqlRequest, GraphQL.Server.IGraphQLExecuter<TSchema> executer, System.Threading.CancellationToken cancellationToken) { }
34+
protected virtual System.Threading.Tasks.Task HandleRequestAsync(Microsoft.AspNetCore.Http.HttpContext context, Microsoft.AspNetCore.Http.RequestDelegate next, System.Collections.Generic.IDictionary<string, object> userContext, GraphQL.Transport.GraphQLRequest[] bodyGQLBatchRequest, GraphQL.Transport.GraphQLRequest gqlRequest, GraphQL.Server.IGraphQLExecuter<TSchema> executer, System.Threading.CancellationToken cancellationToken) { }
3535
public System.Threading.Tasks.Task InvokeAsync(Microsoft.AspNetCore.Http.HttpContext context, Microsoft.AspNetCore.Http.RequestDelegate next) { }
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) { }

0 commit comments

Comments
 (0)