StellaOps.Workflow.Transport.GraphQL

GraphQL transport of the workflow engine: sends GraphQL queries and mutations over HttpClient to configured targets.

PackageStellaOps.Workflow.Transport.GraphQL
ComponentWorkflow
LicenceBUSL-1.1 (Workflow licence)
Package kindLibrary
Target frameworknet10.0

To add the package to a project, see Installing Stella Ops packages.

Namespaces

NamespaceTypes
StellaOps.Workflow.Transport.GraphQL6

StellaOps.Workflow.Transport.GraphQL namespace

TypeKindDescription
FailureTranslatingWorkflowGraphqlTransportclassThe registered IWorkflowGraphqlTransport: WorkflowGraphqlTransportwith the resilience pipeline’s timeout reported as a TimeoutException, and an unreachable target or an open circuit breaker answered as a failed response.
GraphqlWorkflowTransportRoutineclassDependency-injection routine of the GraphQL transport.
WorkflowGraphqlTargetOptionsclassOne GraphQL target: its endpoint URL and the headers every call sends.
WorkflowGraphqlTransportclassNo description.
WorkflowGraphqlTransportOptionsclassTargets and retries of graphql calls (WorkflowGraphqlTransport): WorkflowGraphqlTransport:Targets:<target>:Url, with optional headers per target.
WorkflowGraphqlTransportServiceCollectionExtensionsclassRegisters the GraphQL transport of the Workflow engine.

FailureTranslatingWorkflowGraphqlTransport class

public sealed class FailureTranslatingWorkflowGraphqlTransport : IWorkflowGraphqlTransport

The registered IWorkflowGraphqlTransport: WorkflowGraphqlTransportwith the resilience pipeline’s timeout reported as a TimeoutException, and an unreachable target or an open circuit breaker answered as a failed response.

FailureTranslatingWorkflowGraphqlTransport(WorkflowGraphqlTransport, ILogger<FailureTranslatingWorkflowGraphqlTransport>) constructor

public FailureTranslatingWorkflowGraphqlTransport(WorkflowGraphqlTransport inner, ILogger<FailureTranslatingWorkflowGraphqlTransport> logger)

The registered IWorkflowGraphqlTransport: WorkflowGraphqlTransportwith the resilience pipeline’s timeout reported as a TimeoutException, and an unreachable target or an open circuit breaker answered as a failed response.

ExecuteAsync(WorkflowGraphqlRequest, CancellationToken) method

public Task<WorkflowGraphqlResponse> ExecuteAsync(WorkflowGraphqlRequest request, CancellationToken cancellationToken = default)

Sends the query and returns the response. A failure, such as a non-success status or an errors array in the response, is a response that did not succeed; a call that does not answer in time raises a TimeoutException.

Parameters

Returns

The response.

GraphqlWorkflowTransportRoutine class

public sealed class GraphqlWorkflowTransportRoutine : IDependencyInjectionRoutine

Dependency-injection routine of the GraphQL transport. A host that loads this assembly as a plug-in discovers the routine; it registers exactly what WorkflowGraphqlTransportServiceCollectionExtensions.AddWorkflowGraphqlTransport(IServiceCollection, IConfiguration)registers.

GraphqlWorkflowTransportRoutine() constructor

public GraphqlWorkflowTransportRoutine()

Creates an instance of GraphqlWorkflowTransportRoutine.

Register(IServiceCollection, IConfiguration) method

public IServiceCollection Register(IServiceCollection services, IConfiguration configuration)

Registers what WorkflowGraphqlTransportServiceCollectionExtensions.AddWorkflowGraphqlTransport(IServiceCollection, IConfiguration)registers.

Parameters

Returns

The same service collection.

WorkflowGraphqlTargetOptions class

public sealed class WorkflowGraphqlTargetOptions

One GraphQL target: its endpoint URL and the headers every call sends.

WorkflowGraphqlTargetOptions() constructor

public WorkflowGraphqlTargetOptions()

Creates an instance of WorkflowGraphqlTargetOptions.

Headers property

public IDictionary<string, string> Headers { get; init; }

Headers sent with every call to the target.

Url property

public string Url { get; init; }

The GraphQL endpoint URL of the target.

WorkflowGraphqlTransport class

public sealed class WorkflowGraphqlTransport : IWorkflowGraphqlTransport

No description.

WorkflowGraphqlTransport(IHttpClientFactory, IOptions<WorkflowGraphqlTransportOptions>, ILogger<WorkflowGraphqlTransport>) constructor

public WorkflowGraphqlTransport(IHttpClientFactory httpClientFactory, IOptions<WorkflowGraphqlTransportOptions> options, ILogger<WorkflowGraphqlTransport> logger)

No description.

HttpClientName constant

public const string HttpClientName = "workflow-graphql-transport"

No description.

ExecuteAsync(WorkflowGraphqlRequest, CancellationToken) method

public Task<WorkflowGraphqlResponse> ExecuteAsync(WorkflowGraphqlRequest request, CancellationToken cancellationToken = default)

No description.

WorkflowGraphqlTransportOptions class

public sealed class WorkflowGraphqlTransportOptions

Targets and retries of graphql calls (WorkflowGraphqlTransport): WorkflowGraphqlTransport:Targets:<target>:Url, with optional headers per target.

WorkflowGraphqlTransportOptions() constructor

public WorkflowGraphqlTransportOptions()

Creates an instance of WorkflowGraphqlTransportOptions.

SectionName constant

public const string SectionName = "WorkflowGraphqlTransport"

The configuration section the options bind from: WorkflowGraphqlTransport.

RetryCount property

public int RetryCount { get; set; }

Retries of a failed attempt in the resilience pipeline. The default is 3.

Targets property

public IDictionary<string, WorkflowGraphqlTargetOptions> Targets { get; init; }

The targets that graphql calls name, by name.

TimeoutSeconds property

public int? TimeoutSeconds { get; set; }

Transport-level timeout in seconds for GraphQL calls. Null means no transport-level override.

WorkflowGraphqlTransportServiceCollectionExtensions class

public static class WorkflowGraphqlTransportServiceCollectionExtensions

Registers the GraphQL transport of the Workflow engine.

AddWorkflowGraphqlTransport(IServiceCollection, IConfiguration) extension method

public static IServiceCollection AddWorkflowGraphqlTransport(this IServiceCollection services, IConfiguration configuration)

Registers WorkflowGraphqlTransportas the IWorkflowGraphqlTransport, with its named HTTP client and resilience pipeline, from the {WorkflowGraphqlTransportOptions.SectionName} section.