StellaOps.Workflow.Transport.GraphQL
GraphQL transport of the workflow engine: sends GraphQL queries and mutations over HttpClient to configured targets.
| Package | StellaOps.Workflow.Transport.GraphQL |
| Component | Workflow |
| Licence | BUSL-1.1 (Workflow licence) |
| Package kind | Library |
| Target framework | net10.0 |
To add the package to a project, see Installing Stella Ops packages.
Namespaces
| Namespace | Types |
|---|---|
StellaOps.Workflow.Transport.GraphQL | 6 |
StellaOps.Workflow.Transport.GraphQL namespace
| Type | Kind | Description |
|---|---|---|
FailureTranslatingWorkflowGraphqlTransport | class | 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. |
GraphqlWorkflowTransportRoutine | class | Dependency-injection routine of the GraphQL transport. |
WorkflowGraphqlTargetOptions | class | One GraphQL target: its endpoint URL and the headers every call sends. |
WorkflowGraphqlTransport | class | No description. |
WorkflowGraphqlTransportOptions | class | Targets and retries of graphql calls (WorkflowGraphqlTransport): WorkflowGraphqlTransport:Targets:<target>:Url, with optional headers per target. |
WorkflowGraphqlTransportServiceCollectionExtensions | class | Registers 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
request: The GraphQL request.cancellationToken: Cancels the operation.
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
services: The service collection.configuration: The host configuration.
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.
