Trax.Api.GraphQL.Testing
1.44.2
Prefix Reserved
dotnet add package Trax.Api.GraphQL.Testing --version 1.44.2
NuGet\Install-Package Trax.Api.GraphQL.Testing -Version 1.44.2
<PackageReference Include="Trax.Api.GraphQL.Testing" Version="1.44.2" />
<PackageVersion Include="Trax.Api.GraphQL.Testing" Version="1.44.2" />
<PackageReference Include="Trax.Api.GraphQL.Testing" />
paket add Trax.Api.GraphQL.Testing --version 1.44.2
#r "nuget: Trax.Api.GraphQL.Testing, 1.44.2"
#:package Trax.Api.GraphQL.Testing@1.44.2
#addin nuget:?package=Trax.Api.GraphQL.Testing&version=1.44.2
#tool nuget:?package=Trax.Api.GraphQL.Testing&version=1.44.2
Trax.Api
Part of Trax: business logic you can call, schedule, or serve as an API, with every run recorded in your Postgres. Docs · Getting started · All repos
Trax.Api generates a typed GraphQL API from your trains and [TraxQueryModel] entities, with fail-closed
authorization, request audit and typed clients. It builds on Trax.Scheduler
and runs on HotChocolate; Trax.Dashboard builds on it.
Install
dotnet add package Trax.Api.GraphQL
dotnet add package Trax.Effect.Data.Postgres # storage for the run records and the work queue
dotnet add package Trax.Api.Auth.ApiKey # or Trax.Api.Auth.Jwt, Trax.Api.Auth.Oidc
Example
Adapted from the game server sample. Two attributes put the leaderboard train on the schema as a queued mutation:
[TraxMutation(GraphQLOperation.Queue)]
[TraxAuthorize(Roles = "Admin")]
public class RecalculateLeaderboardTrain
: ServiceTrain<RecalculateLeaderboardInput, RecalculateLeaderboardOutput>,
IRecalculateLeaderboardTrain
// Program.cs: Trax, an auth scheme, and the GraphQL endpoint gated behind it
builder.Services.AddTrax(trax =>
trax.AddEffects(effects => effects.UsePostgres(connectionString))
.AddMediator(typeof(Program).Assembly));
// Keys come from your secret manager, never from source control.
builder.Services.AddTraxApiKeyAuth(keys => keys
.Add(builder.Configuration["ApiKeys:Admin"]!, id: "admin", "Admin"));
builder.Services.AddAuthorization();
builder.Services.AddTraxGraphQL(graphql => graphql.RequireAuthorization());
var app = builder.Build();
app.UseAuthentication();
app.UseAuthorization();
app.UseTraxGraphQL(); // maps at /trax/graphql
mutation {
dispatch {
recalculateLeaderboard(input: { region: "na" }) {
workQueueId
}
}
}
A caller without the Admin role gets a TRAX_AUTHORIZATION error. An exposed train that declares neither
[TraxAuthorize] nor [TraxAllowAnonymous] stops the host from starting.
Where this fits
Trax is split into layers, one repo each. Take the ones you need; the trains you wrote do not change. You are here: Trax.Api.
| Repo | What it adds |
|---|---|
| Trax.Core | Trains, junctions and the chain, with no database and no DI container |
| Trax.Effect | A recorded run for every execution (Postgres, SQLite or in memory), DI, effect providers, the state-machine engine |
| Trax.Mediator | The train bus: run a train by handing over its input, with every chain checked at startup |
| Trax.Scheduler | Cron and interval schedules, retries, dead letters, and workers on other machines or in Lambda |
| Trax.Api | GraphQL generated from your trains, with authentication, audit and typed clients |
| Trax.Dashboard | A Blazor Server UI for runs, schedules and dead letters, mounted in your app |
| Trax.Cli | The trax tool: scaffold a hub and trains from an OpenAPI or GraphQL schema, and state-machine codegen |
| Trax.Samples | Complete sample apps, and the trax-api, trax-scheduler and trax-hub templates |
Docs live in Trax.Docs and are published at traxsharp.net/docs.
Contributing
Read AGENTS.md before changing code. Report vulnerabilities privately as described in SECURITY.md.
License
MIT. There is no commercial edition, and there will not be one.
Trax is an independent open-source project and is not affiliated with the Utah Transit Authority, Trax Retail, or any other organization using the Trax name.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- HotChocolate (>= 16.6.2)
- HotChocolate.AspNetCore (>= 16.6.2)
- HotChocolate.AspNetCore.Authorization (>= 16.6.2)
- HotChocolate.CostAnalysis (>= 16.6.2)
- HotChocolate.Data (>= 16.6.2)
- HotChocolate.Data.EntityFramework (>= 16.6.2)
- HotChocolate.Execution.Projections (>= 16.6.2)
- Microsoft.AspNetCore.Authentication.JwtBearer (>= 10.0.9)
- Microsoft.CodeAnalysis.CSharp (>= 5.9.0)
- Microsoft.EntityFrameworkCore (>= 10.0.12)
- Microsoft.Extensions.DependencyInjection (>= 10.0.12)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.12)
- NUnit (>= 4.6.1)
- Trax.Api.GraphQL (>= 1.44.2)
- Trax.Core.Testing (>= 1.8.0)
- Trax.Effect (>= 1.57.4)
- Trax.Effect.Data (>= 1.57.4)
- Trax.Mediator (>= 1.23.3)
- Trax.Scheduler (>= 1.34.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.44.2 | 0 | 10/1/2026 |
| 1.44.1 | 113 | 9/29/2026 |
| 1.44.0 | 61 | 9/29/2026 |
| 1.43.2 | 119 | 9/24/2026 |
| 1.43.1 | 143 | 9/16/2026 |
| 1.43.0 | 88 | 9/16/2026 |
| 1.42.0 | 93 | 9/15/2026 |
| 1.41.1 | 105 | 9/2/2026 |
| 1.41.0 | 105 | 9/2/2026 |
| 1.40.0 | 208 | 7/29/2026 |
| 1.39.0 | 136 | 7/8/2026 |
| 1.38.1 | 155 | 7/6/2026 |
| 1.38.0 | 166 | 6/2/2026 |
| 1.37.0 | 134 | 6/2/2026 |
| 1.36.0 | 130 | 6/2/2026 |