File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
dataconnect/dataconnect/movie-connector Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ mutation CreateMovie(
8
8
$imageUrl : String !
9
9
$tags : [String ! ] = []
10
10
) @auth (expr : " auth.token.isAdmin == true" ) {
11
- builders ($tenantId : String !) {
12
11
movie_insert (
13
12
data : {
14
13
title : $title
@@ -48,7 +47,7 @@ mutation AddReview(
48
47
$rating : Int !
49
48
$reviewText : String !
50
49
) @auth (level : USER ) {
51
- review_update (
50
+ review_insert (
52
51
data : {
53
52
userId_expr : " auth.uid"
54
53
movieId : $movieId
@@ -61,14 +60,12 @@ mutation AddReview(
61
60
62
61
# Update a user's review for a movie
63
62
mutation UpdateReview (
64
- $id : UUID !
65
63
$movieId : UUID !
66
64
$rating : Int !
67
65
$reviewText : String !
68
- $userId : String !
69
- ) @auth (expr : " auth.uid != null && auth.uid == userId" ) {
66
+ ) @auth (level : USER ) {
70
67
review_update (
71
- id : $id ,
68
+ key : { movieId : $movieId , userId_expr : " auth.uid " } ,
72
69
data : {
73
70
userId_expr : " auth.uid"
74
71
movieId : $movieId
@@ -132,4 +129,4 @@ mutation DeleteMovie($id: UUID!) @auth(level: USER_EMAIL_VERIFIED) {
132
129
mutation DeleteUnpopularMovies ($minRating : Float ! ) @auth (level : USER_EMAIL_VERIFIED ) {
133
130
movie_deleteMany (where : { rating : { le : $minRating } })
134
131
}
135
- # End of example mutations
132
+ # End of example mutations
You canβt perform that action at this time.
0 commit comments