Skip to content

Add [TraxQueryModel] support for GraphQL entity queries#18

Merged
Theauxm merged 3 commits into
mainfrom
feat/query-model-support
Mar 16, 2026
Merged

Add [TraxQueryModel] support for GraphQL entity queries#18
Theauxm merged 3 commits into
mainfrom
feat/query-model-support

Conversation

@Theauxm
Copy link
Copy Markdown
Member

@Theauxm Theauxm commented Mar 16, 2026

Summary

  • TraxGraphQLBuilder with AddDbContext<T>() for registering EF DbContexts
  • QueryModelTypeModule dynamically generates paginated, filterable, sortable GraphQL queries from [TraxQueryModel] entities
  • TrainTypeModule updated to coordinate DiscoverQueries ownership when model registrations exist
  • AddTraxGraphQL() now accepts a builder lambda; parameterless overload preserved for backward compat
  • HotChocolate.Data and HotChocolate.Data.EntityFramework added as dependencies
  • 26 new tests covering pluralization, builder scanning, type generation, and module coordination

Depends on TraxSharp/Trax.Effect#33 (feat/query-model-attribute).

Test plan

  • 158 tests pass (26 new)
  • Zero build warnings
  • Backward compat: parameterless AddTraxGraphQL() still works
  • CSharpier formatted

…raphQL queries

Adds TraxGraphQLBuilder with AddDbContext<T>() registration, QueryModelTypeModule
for dynamic schema generation, and coordination with TrainTypeModule for shared
DiscoverQueries ownership. Supports per-model pagination, filtering, sorting,
and projection via attribute toggles. Includes 26 new tests.
Theauxm added 2 commits March 16, 2026 14:23
Group train and model fields under namespace intermediate types when
GraphQLNamespace is set. Both TrainTypeModule and QueryModelTypeModule
share a RegisteredNamespaceTypes set on GraphQLConfiguration to avoid
duplicate base type creation.
@Theauxm Theauxm merged commit 43c8411 into main Mar 16, 2026
1 of 3 checks passed
@Theauxm Theauxm deleted the feat/query-model-support branch March 16, 2026 21:36
@traxsharp
Copy link
Copy Markdown

traxsharp Bot commented Mar 16, 2026

This PR is included in version 1.11.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant