mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-25 00:36:31 +02:00
24 lines
761 B
GraphQL
24 lines
761 B
GraphQL
mutation CreateMovie($title: String!, $genre: String!, $imageUrl: String!)
|
|
@auth(level: USER_EMAIL_VERIFIED, insecureReason: "Any email verified users can create a new movie.") {
|
|
movie_insert(data: { title: $title, genre: $genre, imageUrl: $imageUrl })
|
|
}
|
|
|
|
mutation UpsertUser($username: String!) @auth(level: USER) {
|
|
user_upsert(data: { id_expr: "auth.uid", username: $username })
|
|
}
|
|
|
|
mutation AddReview($movieId: UUID!, $rating: Int!, $reviewText: String!)
|
|
@auth(level: USER) {
|
|
review_upsert(
|
|
data: {
|
|
userId_expr: "auth.uid"
|
|
movieId: $movieId
|
|
rating: $rating
|
|
reviewText: $reviewText
|
|
}
|
|
)
|
|
}
|
|
|
|
mutation DeleteReview($movieId: UUID!) @auth(level: USER) {
|
|
review_delete(key: { userId_expr: "auth.uid", movieId: $movieId })
|
|
}
|