feat: add BuildJsonApiQueryAsync for custom query execution#79
Merged
Erlend Ellefsen (erlendellefsen) merged 2 commits intoJan 25, 2026
Conversation
- Add `BuildJsonApiQueryAsync<T>()` method to `JsonApiController` - Returns processed `IQueryable` without pagination for exports/aggregations - Add `JsonApiQueryResult<T>` result class with `Query`, `Parameters`, `TotalCount` - Add 17 tests covering filters, includes, sorting, count behavior - Consolidate statistics docs into new `build-query.md`
Copilot started reviewing on behalf of
Erlend Ellefsen (erlendellefsen)
January 25, 2026 10:28
View session
There was a problem hiding this comment.
Pull request overview
This PR adds a new BuildJsonApiQueryAsync method to enable custom query execution scenarios like CSV exports, aggregations, and projections. The method processes JSON:API query parameters (filters, includes, sorting) but intentionally does not apply pagination, allowing developers to handle the final query execution according to their needs.
Changes:
- Adds
BuildJsonApiQueryAsync<T>()method that returns aJsonApiQueryResult<T>with the processed query, parsed parameters, and optional total count - Introduces
JsonApiQueryResult<T>class to encapsulate the query result - Consolidates statistics/aggregations documentation from
statistics-and-aggregations.mdinto a comprehensivebuild-query.mdguide covering the new API and various use cases - Adds 17 integration and unit tests covering filters, includes, sorting, count behavior, and edge cases
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
docs/docs/upgrade-guide.md |
Documents v1.6.0 release with feature description, usage examples, and migration notes |
docs/docs/toc.yml |
Updates table of contents to replace statistics docs with new build-query guide and adds upgrade guide + contributing links |
docs/docs/statistics-and-aggregations.md |
Removes old statistics documentation (content migrated to build-query.md) |
docs/docs/build-query.md |
New comprehensive documentation covering BuildJsonApiQueryAsync usage, examples for exports/aggregations/projections, performance tips, and method comparison table |
JsonApiToolkit/Models/Querying/JsonApiQueryResult.cs |
New result class with Query, Parameters, and TotalCount properties using required init-only properties |
JsonApiToolkit/Controllers/JsonApiController.cs |
Implements BuildJsonApiQueryAsync method following similar patterns to JsonApiQueryAsync but without pagination |
JsonApiToolkit.Tests/Controllers/BuildJsonApiQueryAsyncTests.cs |
Comprehensive test suite with 17 tests covering basic queries, filters, includes, sorting, pagination behavior, and edge cases |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Erlend Ellefsen (erlendellefsen)
pushed a commit
that referenced
this pull request
Jan 25, 2026
🤖 I have created a release *beep* *boop* --- ## [1.6.0](v1.5.1...v1.6.0) (2026-01-25) ### Features * add `BuildJsonApiQueryAsync` for custom query execution ([#79](#79)) ([66a8a00](66a8a00)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: intility-release-bot[bot] <175299729+intility-release-bot[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BuildJsonApiQueryAsync<T>()method toJsonApiControllerIQueryablewithout pagination for exports/aggregationsJsonApiQueryResult<T>result class withQuery,Parameters,TotalCountbuild-query.md