File tree Expand file tree Collapse file tree 1 file changed +23
-2
lines changed
dataconnect/dataconnect/movie-connector Expand file tree Collapse file tree 1 file changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,8 @@ mutation CreateMovie(
7
7
$description : String
8
8
$imageUrl : String !
9
9
$tags : [String ! ] = []
10
- ) @auth (level : USER_EMAIL_VERIFIED ) {
10
+ ) @auth (expr : " auth.token.isAdmin == true" ) {
11
+ builders ($tenantId : String !) {
11
12
movie_insert (
12
13
data : {
13
14
title : $title
@@ -47,7 +48,27 @@ mutation AddReview(
47
48
$rating : Int !
48
49
$reviewText : String !
49
50
) @auth (level : USER ) {
50
- review_upsert (
51
+ review_update (
52
+ data : {
53
+ userId_expr : " auth.uid"
54
+ movieId : $movieId
55
+ rating : $rating
56
+ reviewText : $reviewText
57
+ reviewDate_date : { today : true }
58
+ }
59
+ )
60
+ }
61
+
62
+ # Update a user's review for a movie
63
+ mutation UpdateReview (
64
+ $id : UUID !
65
+ $movieId : UUID !
66
+ $rating : Int !
67
+ $reviewText : String !
68
+ $userId : String !
69
+ ) @auth (expr : " auth.uid != null && auth.uid == userId" ) {
70
+ review_update (
71
+ id : $id ,
51
72
data : {
52
73
userId_expr : " auth.uid"
53
74
movieId : $movieId
You can’t perform that action at this time.
0 commit comments