Skip to content

Commit

Permalink
Added missing await #352
Browse files Browse the repository at this point in the history
  • Loading branch information
rstaib committed Jan 8, 2019
1 parent 70b8d94 commit 18e768f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Core/Core/Execution/QueryExecuter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ public Task<IExecutionResult> ExecuteAsync(
throw new ArgumentNullException(nameof(request));
}

return ExecuteInternalAsync(request, cancellationToken);
}

private async Task<IExecutionResult> ExecuteInternalAsync(
QueryRequest request,
CancellationToken cancellationToken)
{
IServiceProvider services = (request.Services == null)
? _applicationServices.Include(Schema.Services)
: _applicationServices.Include(request.Services);
Expand All @@ -55,14 +62,15 @@ public Task<IExecutionResult> ExecuteAsync(
scope.ServiceProvider,
request.ToReadOnly());

return ExecuteMiddlewareAsync(context);
return await ExecuteMiddlewareAsync(context)
.ConfigureAwait(false);
}
}

private async Task<IExecutionResult> ExecuteMiddlewareAsync(
IQueryContext context)
{
await _queryDelegate(context);
await _queryDelegate(context).ConfigureAwait(false);

if (context.Result == null)
{
Expand Down

0 comments on commit 18e768f

Please sign in to comment.