Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrated new executor interfaces and added documentation.
- Loading branch information
1 parent
a4db781
commit c668be4
Showing
5 changed files
with
69 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
namespace HotChocolate.Execution | ||
{ | ||
internal interface IOperationExecutor | ||
{ | ||
Task<IExecutionResult> ExecuteAsync( | ||
IOperationContext executionContext, | ||
CancellationToken cancellationToken); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
using System; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
namespace HotChocolate.Execution | ||
{ | ||
/// <summary> | ||
/// This executor processes GraphQL query, mutation and subscription requests for the | ||
/// <see cref="Schema" /> to which it is bound to. | ||
/// </summary> | ||
public interface IQueryExecutor | ||
: IDisposable | ||
{ | ||
/// <summary> | ||
/// Gets the schema to which this executor is bound to. | ||
/// </summary> | ||
/// <value></value> | ||
ISchema Schema { get; } | ||
|
||
/// <summary> | ||
/// Executes the given GraphQL <paramref name="request" />. | ||
/// </summary> | ||
/// <param name="request"> | ||
/// The GraphQL request object. | ||
/// </param> | ||
/// <param name="cancellationToken"> | ||
/// The cancellation token. | ||
/// </param> | ||
/// <returns> | ||
/// Returns the execution result of the given GraphQL <paramref name="request" />. | ||
/// If the request operation is a simple query or mutation the result is a | ||
/// <see cref="IReadOnlyQueryResult" />. | ||
/// | ||
/// If the request operation is a query or mutation where data is deferred, streamed or | ||
/// includes live data the result is a <see cref="IResponseStream" /> where reach result | ||
/// that the <see cref="IResponseStream" /> yields is a <see cref="IReadOnlyQueryResult" />. | ||
/// | ||
/// If the request operation is a subscription the result is a | ||
/// <see cref="IResponseStream" /> where reach result that the | ||
/// <see cref="IResponseStream" /> yields is a | ||
/// <see cref="IReadOnlyQueryResult" />. | ||
/// </returns> | ||
Task<IExecutionResult> ExecuteAsync( | ||
IReadOnlyQueryRequest request, | ||
CancellationToken cancellationToken = default); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
using System.Threading.Tasks; | ||
|
||
namespace HotChocolate.Execution | ||
{ | ||
public delegate RequestDelegate RequestMiddleware(RequestDelegate next); | ||
|
||
public delegate Task RequestDelegate(IRequestContext context); | ||
} |