Skip to content

feat: add BuildJsonApiQueryAsync for custom query execution#79

Merged
Erlend Ellefsen (erlendellefsen) merged 2 commits into
mainfrom
feat/build-json-api-query
Jan 25, 2026
Merged

feat: add BuildJsonApiQueryAsync for custom query execution#79
Erlend Ellefsen (erlendellefsen) merged 2 commits into
mainfrom
feat/build-json-api-query

Conversation

@erlendellefsen

Copy link
Copy Markdown
Collaborator
  • 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

- 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 AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 a JsonApiQueryResult<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.md into a comprehensive build-query.md guide 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.

Comment thread docs/docs/build-query.md Outdated
@erlendellefsen Erlend Ellefsen (erlendellefsen) merged commit 66a8a00 into main Jan 25, 2026
2 checks passed
@erlendellefsen Erlend Ellefsen (erlendellefsen) deleted the feat/build-json-api-query branch January 25, 2026 10:43
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>
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.

2 participants