File tree Expand file tree Collapse file tree
dataconnect/dataconnect/movie-connector Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ mutation CreateMovie(
88 $imageUrl : String !
99 $tags : [String ! ] = []
1010) @auth (expr : " auth.token.isAdmin == true" ) {
11- builders ($tenantId : String !) {
1211 movie_insert (
1312 data : {
1413 title : $title
@@ -48,7 +47,7 @@ mutation AddReview(
4847 $rating : Int !
4948 $reviewText : String !
5049) @auth (level : USER ) {
51- review_update (
50+ review_insert (
5251 data : {
5352 userId_expr : " auth.uid"
5453 movieId : $movieId
@@ -61,14 +60,12 @@ mutation AddReview(
6160
6261# Update a user's review for a movie
6362mutation UpdateReview (
64- $id : UUID !
6563 $movieId : UUID !
6664 $rating : Int !
6765 $reviewText : String !
68- $userId : String !
69- ) @auth (expr : " auth.uid != null && auth.uid == userId" ) {
66+ ) @auth (level : USER ) {
7067 review_update (
71- id : $id ,
68+ key : { movieId : $movieId , userId_expr : " auth.uid " } ,
7269 data : {
7370 userId_expr : " auth.uid"
7471 movieId : $movieId
@@ -132,4 +129,4 @@ mutation DeleteMovie($id: UUID!) @auth(level: USER_EMAIL_VERIFIED) {
132129mutation DeleteUnpopularMovies ($minRating : Float ! ) @auth (level : USER_EMAIL_VERIFIED ) {
133130 movie_deleteMany (where : { rating : { le : $minRating } })
134131}
135- # End of example mutations
132+ # End of example mutations
You canβt perform that action at this time.
0 commit comments