-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/list-faceting
- Loading branch information
Showing
8 changed files
with
232 additions
and
71 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
56 changes: 56 additions & 0 deletions
56
schema/testdata/errors/relationships_update_nested_invalid_input.keel
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,56 @@ | ||
model Post { | ||
fields { | ||
name Text | ||
another Text | ||
votes Vote[] | ||
category Category? | ||
} | ||
|
||
actions { | ||
create createPost1() with (name, another, votes.score) | ||
//expect-error:51:59:ActionInputError:Cannot provide the id of nested records which do not exist yet | ||
create createPost2() with (name, another, votes.id) | ||
//expect-error:38:49:ActionInputError:Update actions cannot perform field updates on nested models. | ||
update updatePost1(id) with (votes.score) | ||
update updatePost2(id) with (votes.id) | ||
update updatePost3(id) with (category.id) | ||
//expect-error:38:51:ActionInputError:Update actions cannot perform field updates on nested models. | ||
update updatePost4(id) with (category.name) | ||
} | ||
} | ||
|
||
model Vote { | ||
fields { | ||
score Number | ||
post Post? | ||
} | ||
|
||
actions { | ||
create createVote1() with (score, post.id) | ||
create createVote2() with (score, post.name, post.another) | ||
update updateVote1(id) with (score) | ||
update updateVote2(id) with (post.id) | ||
//expect-error:47:57:ActionInputError:Update actions cannot perform field updates on nested models. | ||
update updateVote3(id) with (post.id, post.name?) | ||
//expect-error:38:48:ActionInputError:Update actions cannot perform field updates on nested models. | ||
update updateVote4(id) with (post.name?) | ||
//expect-error:38:47:ActionInputError:Update actions cannot perform field updates on nested models. | ||
//expect-error:49:61:ActionInputError:Update actions cannot perform field updates on nested models. | ||
update updateVote5(id) with (post.name, post.another) | ||
update updateVote6(id) with (score, post.id) | ||
} | ||
} | ||
|
||
model Category { | ||
fields { | ||
name Text | ||
posts Post[] | ||
} | ||
|
||
actions { | ||
update updateCategory1(id) with (name) | ||
update updateCategory2(id) with (posts.id) | ||
//expect-error:42:52:ActionInputError:Update actions cannot perform field updates on nested models. | ||
update updateCategory3(id) with (posts.name) | ||
} | ||
} |
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.