Skip to content

Commit

Permalink
docs: update batch-loader references
Browse files Browse the repository at this point in the history
  • Loading branch information
fratzinger committed May 22, 2022
1 parent 128db6b commit 5898a56
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions docs/guides.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ module.exports = {

We often want to combine rows from two or more tables based on a relationship between them. The `fastJoin` hook will select records that have matching values in both tables. It can batch service calls and cache records, thereby needing roughly an order of magnitude fewer database calls than the `populate` hook, i.e. _2_ calls instead of _20_. It uses a [GraphQL](http://graphql.org/)-like imperative API.

`fastJoin` is not restricted to using data from Feathers services. Resources for which there are no Feathers adapters can [also be used](/v1/batch-loader/common-patterns.html#Using-non-Feathers-services).

### Usage

```js
Expand Down Expand Up @@ -260,7 +258,7 @@ const postResolvers = {
};
```
A resolver function can make any sort of modification to the passed record; it is not limited to making service calls. Resolvers can use resources for which there is [no Feathers adapter](/v1/batch-loader/common-patterns.html#Using-non-Feathers-services).
A resolver function can make any sort of modification to the passed record; it is not limited to making service calls.
Here, the starerCount resolver adds the field `starerCount` containing a count of the `starIds`.
Expand Down Expand Up @@ -421,7 +419,7 @@ We have been looking till now into the structure and flexibility of `fastJoin`.
We will use batch-loaders to dramatically reduce the number of database calls needed. Its not uncommon for operations that would have required _20_ database calls to make only _2_ using batch-loaders.
You need to understand batch-loaders before we proceed, so [read about them now.](../batch-loader/guide.html)
You need to understand batch-loaders before we proceed, so [read about them now.](https://github.com/feathersjs-ecosystem/batch-loader)
### Using a Simple Batch-Loader
Expand Down Expand Up @@ -524,7 +522,7 @@ const postResolvers = {
}
```
> The [batch-loader guide](../batch-loader) explains how to create batch-loaders.
> The [batch-loader guide](https://github.com/feathersjs-ecosystem/batch-loader) explains how to create batch-loaders.
### Putting It All Together
Expand Down
2 changes: 1 addition & 1 deletion docs/hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@ The `cache` hook also makes `get` service calls more efficient.
Relationships such as `1:1`, `1:m`, `n:1`, and `n:m` relationships can be handled.
`fastJoin` uses a GraphQL-like imperative API, and it is not restricted to using data from Feathers services. Resources for which there are no Feathers adapters can [be used.](../batch-loader/common-patterns.html#Using-non-Feathers-services)
`fastJoin` uses a GraphQL-like imperative API, and it is not restricted to using data from Feathers services. Resources for which there are no Feathers adapters can [be used.](https://github.com/feathersjs-ecosystem/batch-loader)
The companion `@feathers-plus/cache` implements a least recently-used cache which discards the least recently used items first. When used in conjunction with the `cache` hook, it can be used to implement persistent caches for BatchLoaders. BatchLoaders configured this way would retain their cache between requests, eliminating the need to _prime_ the cache at the start of each request.
Expand Down

0 comments on commit 5898a56

Please sign in to comment.