Explanation

Query models and query trains

Trax has two ways to put a read under discover. A [TraxQuery] train runs business logic and returns a computed result. A [TraxQueryModel] entity is a table read, with the paging, filtering and sorting arguments generated from the entity.

[TraxQuery][TraxQueryModel]
TargetTrain class (workflow)Entity class (data model)
Resolves viaITrainBus.RunAsyncDbContext.Set<T>() → IQueryable
InputTyped input DTOFilter/sort/page arguments (auto-generated)
OutputTyped output DTOEntity properties (with projection)
Use caseBusiness logic, computed resultsDirect CRUD reads, admin dashboards
Schema locationdiscover { trainName(input: ...) }discover { modelNames(first: ..., where: ...) }

Both appear under the discover namespace in the GraphQL schema.

A query train is the place for a read that computes, checks or combines; it has a typed input, runs as a train with its effects, and the caller sees only the output type. A query model is the place for a read the caller shapes: which rows, in what order, which columns. Projection means only the selected columns are read, so a wide table costs what the query asks for.