-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(graphql): Update docs for new filterable relations
- Loading branch information
1 parent
2f852d9
commit 7fdae8e
Showing
6 changed files
with
213 additions
and
114 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
23 changes: 23 additions & 0 deletions
23
documentation/docs/migration-guides/v0.15.x-to-v0.16.x.mdx
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
title: v0.15.x to v0.16.x | ||
--- | ||
|
||
import Tabs from '@theme/Tabs'; | ||
import TabItem from '@theme/TabItem'; | ||
|
||
## Filter on Relations | ||
|
||
In `v0.16.x` we made a big step forward in the functionality of relations by allowing for filtering on their properties. While making this change it was aso decided to unify the way that relations are defined. | ||
|
||
In previous versions of `nestjs-query` you could define relations using the `@Relation` or `@Connection` decorator as well as manually defining them when creating your resolvers, this leads to an in consistent experience while using `nestjs-query`. In the latest version all relations **MUST** be defined using the decorators. | ||
|
||
In `v0.16.x` there are two new decorators (`@FilterableRelation`, `@FilterableConnection`) exposed to allow you to decide if end users should be able to filter on the relation. | ||
|
||
To read more about the new decorators as well as defining relations you can read the [`relations docs`](../graphql/relations.mdx) | ||
|
||
|
||
## Filter Definitions | ||
|
||
In `v0.16.x` filters are defined based on the operation (read, update, delete). In previous versions of `nestjs-query` all filters for a type in graphql were the same. In `v0.16.x` this behavior needed to change in order to support filtering on relations. | ||
|
||
This should be a passive change for most, however the generated graphql schema will contain new types for each filter operation. |
This file contains 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
Oops, something went wrong.