From e1d17eec44f125c8006bc8c678805aa9ef983ebb Mon Sep 17 00:00:00 2001 From: tada5hi Date: Thu, 27 Oct 2022 17:03:48 +0200 Subject: [PATCH] docs: enhanced query docs --- README.MD | 12 ++++++++++-- docs/guide/index.md | 10 ++++++++-- docs/guide/query.md | 4 +++- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/README.MD b/README.MD index 87deb6df..622eeae4 100644 --- a/README.MD +++ b/README.MD @@ -9,7 +9,13 @@ This is a library to - `create`, `drop` & `seed` the (default-) database 🔥 -- validate, parse & apply `fields, filter[s], include[s], page and sort` parameter values ( extended **JSON:API** specification) +- manage one or many data-source instances 👻 +- parse & apply query parameters (extended **JSON:API** specification & fully typed) to: + - `filter` (related) resources according to one or more criteria, + - reduce (related) resource `fields`, + - `include` related resources, + - `sort` resources according to one or more criteria, + - limit the number of resources returned in a response by `page` limit & offset **Table of Contents** @@ -448,7 +454,9 @@ import UserFactory from 'user.factory'; ### Query The query submodule enables query parameter (fields, filter, ...) values to be build, parsed & validated. Therefore, the [rapiq](https://www.npmjs.com/package/rapiq) library is used under the hood. -The main functions and types are also exposed by this library. + +The query parameter options (allowed, default, ...) are fully typed 🔥 and depend on the (nested-) properties of the target entity passed to +the typeorm query builder. For explanation proposes, two simple entities with a relation between them are declared to demonstrate the usage of the query utils: diff --git a/docs/guide/index.md b/docs/guide/index.md index 40e36acd..7de80861 100644 --- a/docs/guide/index.md +++ b/docs/guide/index.md @@ -2,8 +2,14 @@ This is a library to: - `create`, `drop` & `seed` the (default-) database 🔥 -- validate, parse & apply `fields, filter[s], include[s], page and sort` parameter values ( extended **JSON:API** specification) - +- manage one or many data-source instances 👻 +- parse & apply query parameters (extended **JSON:API** specification & fully typed) to: + - `filter` (related) resources according to one or more criteria, + - reduce (related) resource `fields`, + - `include` related resources, + - `sort` resources according to one or more criteria, + - limit the number of resources returned in a response by `page` limit & offset + ::: warning **Important NOTE** The guide is under construction ☂ at the moment. So please stay patient or contribute to it, till it covers all parts ⭐. diff --git a/docs/guide/query.md b/docs/guide/query.md index a4755ec3..9d8166ec 100644 --- a/docs/guide/query.md +++ b/docs/guide/query.md @@ -1,7 +1,9 @@ # Query The query submodule enables query parameter (fields, filter, ...) values to be build, parsed & validated. Therefore, the [rapiq](https://www.npmjs.com/package/rapiq) library is used under the hood. -The main functions and types are also exposed by this library. + +The query parameter options (allowed, default, ...) are fully typed 🔥 and depend on the (nested-) properties of the target entity passed to +the typeorm query builder. :::info Info For more details, get in touch with the rapiq [documentation](https://rapiq.tada5hi.net/).