Class GraphQLSubscription

Namespace
ProtoTest.GraphQL
Assembly
ProtoTest.GraphQL.dll
public sealed class GraphQLSubscription : IAsyncEnumerable<GraphQLResponse>, IAsyncDisposable
Inheritance
GraphQLSubscription
Implements
Inherited Members
Extension Methods

Properties

IsCompleted

public bool IsCompleted { get; }

Property Value

bool

Transport

public GraphQLSubscriptionTransport Transport { get; }

Property Value

GraphQLSubscriptionTransport

Methods

DisposeAsync()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.

public ValueTask DisposeAsync()

Returns

ValueTask

A task that represents the asynchronous dispose operation.

ExpectNextAsync<TShape>(TShape, CancellationToken)

public Task<GraphQLResponse> ExpectNextAsync<TShape>(TShape expectedShape, CancellationToken cancellationToken = default)

Parameters

expectedShape TShape
cancellationToken CancellationToken

Returns

Task<GraphQLResponse>

Type Parameters

TShape

GetAsyncEnumerator(CancellationToken)

Iterates the subscription's events. The enumerator disposes the previous event as it advances, so await foreach without a per-element using does not leak a document and response per event; the event currently yielded - and the last one - stay yours to use (and dispose), like an event from NextAsync(CancellationToken).

public IAsyncEnumerator<GraphQLResponse> GetAsyncEnumerator(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

IAsyncEnumerator<GraphQLResponse>

NextAsync(CancellationToken)

public Task<GraphQLResponse?> NextAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task<GraphQLResponse>