Skip to content

Commit cee8bfe

Browse files
committed
Allow access to the subscription request context
1 parent acc6c5a commit cee8bfe

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/HotChocolate/Core/src/Execution/Processing/ISubscription.cs

+6-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ public interface ISubscription
1111
ulong Id { get; }
1212

1313
/// <summary>
14-
/// The compiled subscription operation.
14+
/// Gets the compiled subscription operation.
1515
/// </summary>
1616
IOperation Operation { get; }
17+
18+
/// <summary>
19+
/// Gets the global request state.
20+
/// </summary>
21+
IDictionary<string, object?> ContextData { get; }
1722
}

src/HotChocolate/Core/src/Execution/Processing/SubscriptionExecutor.Subscription.cs

+3
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ public IAsyncEnumerable<IOperationResult> ExecuteAsync()
118118
/// <inheritdoc />
119119
public IOperation Operation => _requestContext.Operation!;
120120

121+
/// <inheritdoc />
122+
public IDictionary<string, object?> ContextData => _requestContext.ContextData;
123+
121124
public async ValueTask DisposeAsync()
122125
{
123126
if (!_disposed)

0 commit comments

Comments
 (0)