Attributes
Every attribute Trax reads ships in the Trax.Effect package, in the Trax.Effect.Attributes namespace, so a train library can carry them without referencing the API, scheduler or GraphQL packages that act on them. The GraphQL exposure attributes are documented with the GraphQL API.
Authorization
| Attribute | Targets | Description |
|---|
| TraxAuthorize | Class, interface, method | Requires an authenticated caller, a policy, or a role. Policies AND, roles OR. |
| TraxAllowAnonymous | Class, interface, method | Declares a GraphQL-exposed surface intentionally public |
| TraxAuthorization | | Reads the two attributes above off a type or method |
Data
| Attribute | Targets | Description |
|---|
| TraxSensitive | Property, field, parameter, enum, class, struct | Masks a value in the stored input and output, junction logs and lifecycle hooks; withholds a question's answers |
Execution
| Attribute | Targets | Description |
|---|
| TraxRemote | Class | Sends the train's queued runs to the first remote submitter |
| TraxConcurrencyLimit | Class | Caps concurrent direct runs of the train |
| Inject | Property | Property injection for ServiceTrain's own framework services |
GraphQL exposure
| Attribute | Targets | Description |
|---|
| TraxQuery / TraxMutation | Class | Exposes a train as a GraphQL query or mutation |
| TraxBroadcast | Class | Publishes the train's lifecycle events to GraphQL subscriptions |
| TraxQueryModel | Class | Exposes an EF entity as a paged, filterable GraphQL query |
| TraxMachine | Class | Serves a state machine through its own typed operations |