Attributes

Every attribute Trax reads, and what each one changes. They all live in Trax.Effect.Attributes, in the Trax.Effect package, so a train library can carry them without referencing the API, scheduler or GraphQL packages that act on them.

using Trax.Effect.Attributes;
 
[TraxMutation]
[TraxAuthorize(Roles = "Admin")]
[TraxConcurrencyLimit(10)]
public class RefundOrderTrain : ServiceTrain<RefundInput, RefundResult>, IRefundOrderTrain { ... }
 
public record RefundInput(long OrderId, [property: TraxSensitive] string ApprovalCode);

Authorization

AttributeTargetsDescription
TraxAuthorizeClass, interface, methodRequires an authenticated caller, a policy, or a role. Policies AND, roles OR.
TraxAllowAnonymousClass, interface, methodDeclares a GraphQL-exposed surface intentionally public

Data

AttributeTargetsDescription
TraxSensitiveProperty, field, parameterMasks a value in the stored input and output, junction logs and lifecycle hooks

Execution

AttributeTargetsDescription
TraxRemoteClassSends the train's queued runs to the first remote submitter
TraxConcurrencyLimitClassCaps concurrent direct runs of the train

GraphQL exposure

AttributeTargetsDescription
TraxQuery / TraxMutationClassExposes a train as a GraphQL query or mutation
TraxBroadcastClassPublishes the train's lifecycle events to GraphQL subscriptions
TraxQueryModelClassExposes an EF entity as a paged, filterable GraphQL query

Framework

AttributeTargetsDescription
InjectPropertyProperty injection for ServiceTrain's own framework services. Not for junction or train dependencies.