-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
34 additions
and
3 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
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,11 @@ | ||
namespace GraphQLParser.Visitors; | ||
|
||
/// <summary> | ||
/// An implementation of <see cref="IASTVisitorContext"/> that only contains a <see cref="CancellationToken"/>. | ||
/// Ideal for use in cases where there is no context variables. | ||
/// </summary> | ||
public struct DefaultVisitorContext : IASTVisitorContext | ||
{ | ||
/// <inheritdoc/> | ||
public CancellationToken CancellationToken { get; set; } | ||
} |
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 @@ | ||
namespace GraphQLParser.Visitors; | ||
|
||
/// <summary> | ||
/// An implementation of <see cref="IASTVisitorContext"/> that does nothing. | ||
/// Ideal for use in cases where the visitor runs synchronously, there is no context | ||
/// variables, and cancellation is not required. | ||
/// </summary> | ||
public struct NullVisitorContext : IASTVisitorContext | ||
{ | ||
/// <inheritdoc/> | ||
public readonly CancellationToken CancellationToken => default; | ||
} |