-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Move relation field properties onto collection (#2529)
## Relevant issue(s) Resolves #2451 #1911 #2408 ## Description Moves relation field properties onto collection description from schema description. This allows for one-sided relations to be defined via `PatchSchema`. There is no way atm to create them using an SDL, but we could add a directive or something at somepoint if we want. As the adding of fields via `PatchCollection` has not yet been enabled, this does prevent users from adding secondary relation fields to an existing schema. I'll create a ticket before merging this to allow this, it is my strong preference to not do that in this already large and fiddly PR though. As the internal codebase relies on the setting of secondary fields via `client.Document`, `client.Document` now requires a collection, not just the schema, when being constructed. We will likely want to find a way to avoid that in the future. This PR also moves some validation from the graphql package into `db`, not all of it has been moved, but that is a long term wish of mine. The `db` package validation can/should be improved further making rule reuse across `PatchCollection`, `PatchSchema` and `CreateCollection` (SDL), however I would rather not spend too much effort on that in this PR. This includes moving it out of the `collection.go` file. It might resolve #2380 but I'd rather not bring that into scope. If I'm waiting around for reviews I might verify that here though. This should conclude the transfer of local properties off of the schema object :)
- Loading branch information
1 parent
734b326
commit 4a75f23
Showing
116 changed files
with
1,474 additions
and
2,293 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
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
Oops, something went wrong.