Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for IExecutable to Data (#2527)
- Loading branch information
1 parent
5a1d67d
commit ad6cf46
Showing
134 changed files
with
3,617 additions
and
326 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,53 @@ | ||
using System.Collections; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
#nullable enable | ||
|
||
namespace HotChocolate | ||
{ | ||
/// <summary> | ||
/// Represents a abstract executable that is well known in the framework. If the execution | ||
/// engine encounters a <see cref="IExecutable"/>, it will call execute it | ||
/// </summary> | ||
public interface IExecutable | ||
{ | ||
ValueTask<object> ExecuteAsync(CancellationToken cancellationToken); | ||
/// <summary> | ||
/// The current state of the executable | ||
/// </summary> | ||
object Source { get; } | ||
|
||
/// <summary> | ||
/// Executes the executable and returns a list | ||
/// </summary> | ||
/// <param name="cancellationToken"> | ||
/// A cancellation token that can be used to cancel the execution. | ||
/// </param> | ||
/// <returns>Returns a arbitrary list</returns> | ||
ValueTask<IList> ToListAsync(CancellationToken cancellationToken); | ||
|
||
/// <summary> | ||
/// Returns the first element of a sequence, or a default value if the sequence contains no | ||
/// elements. | ||
/// </summary> | ||
/// <param name="cancellationToken"> | ||
/// A cancellation token that can be used to cancel the execution. | ||
/// </param> | ||
/// <returns>Returns the result</returns> | ||
ValueTask<object?> FirstOrDefaultAsync(CancellationToken cancellationToken); | ||
|
||
/// <summary> | ||
/// Returns the only element of a default value if no such element exists. This method | ||
/// throws an exception if more than one element satisfies the condition. | ||
/// </summary> | ||
/// <param name="cancellationToken"></param> | ||
/// <returns></returns> | ||
ValueTask<object?> SingleOrDefaultAsync(CancellationToken cancellationToken); | ||
|
||
/// <summary> | ||
/// Prints the executable in its current state | ||
/// </summary> | ||
/// <returns>A string that represents the executables state</returns> | ||
string Print(); | ||
} | ||
} |
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
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
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
58 changes: 29 additions & 29 deletions
58
...e/Core/test/Types.CursorPagination.Tests/HotChocolate.Types.CursorPagination.Tests.csproj
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 |
---|---|---|
@@ -1,29 +1,29 @@ | ||
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="Current"> | ||
|
||
<PropertyGroup> | ||
<AssemblyName>HotChocolate.Types.Tests</AssemblyName> | ||
<RootNamespace>HotChocolate</RootNamespace> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\src\Core\HotChocolate.Core.csproj" /> | ||
<ProjectReference Include="..\Types.Tests.Documentation\HotChocolate.Types.Tests.Documentation.csproj" /> | ||
<ProjectReference Include="..\Utilities\HotChocolate.Tests.Utilities.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Update="$(MSBuildProjectDirectory)\__resources__\*.*"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</None> | ||
<None Update="$(MSBuildProjectDirectory)\xunit.runner.json"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</None> | ||
</ItemGroup> | ||
|
||
<!--For Visual Studio for Mac Test Explorer we need this reference here--> | ||
<ItemGroup> | ||
<PackageReference Include="System.ComponentModel.Annotations" Version="4.7.0" /> | ||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" /> | ||
</ItemGroup> | ||
|
||
</Project> | ||
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="Current"> | ||
|
||
<PropertyGroup> | ||
<AssemblyName>HotChocolate.Types.Tests</AssemblyName> | ||
<RootNamespace>HotChocolate</RootNamespace> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\src\Core\HotChocolate.Core.csproj"/> | ||
<ProjectReference Include="..\Types.Tests.Documentation\HotChocolate.Types.Tests.Documentation.csproj"/> | ||
<ProjectReference Include="..\Utilities\HotChocolate.Tests.Utilities.csproj"/> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Update="$(MSBuildProjectDirectory)\__resources__\*.*"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</None> | ||
<None Update="$(MSBuildProjectDirectory)\xunit.runner.json"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</None> | ||
</ItemGroup> | ||
|
||
<!--For Visual Studio for Mac Test Explorer we need this reference here--> | ||
<ItemGroup> | ||
<PackageReference Include="System.ComponentModel.Annotations" Version="4.7.0"/> | ||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1"/> | ||
</ItemGroup> | ||
|
||
</Project> |
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
Oops, something went wrong.