Skip to content

Commit b0871ba

Browse files
committed
[π˜€π—½π—Ώ] initial version
Created using spr 1.3.6-beta.1
1 parent 739dc3b commit b0871ba

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

β€Ždataconnect/dataconnect/movie-connector/mutations.gql

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff 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
6362
mutation 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) {
132129
mutation 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

0 commit comments

Comments
Β (0)