mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-30 03:16:25 +02:00
chore: prepare cloud merge point with docker and firebase configs in movexe fork Boris account? No, current user.
This commit is contained in:
parent
b38a297349
commit
4a6b335ce3
14 changed files with 263 additions and 2 deletions
9
dataconnect/example/connector.yaml
Normal file
9
dataconnect/example/connector.yaml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
connectorId: example
|
||||
generate:
|
||||
javascriptSdk:
|
||||
- outputDir: ..\..\..\..\Antigravity\resources\app\src\dataconnect-generated
|
||||
package: "@dataconnect/generated"
|
||||
packageJsonDir: ..\..\..\..\Antigravity\resources\app
|
||||
react: true
|
||||
angular: false
|
||||
clientCache: {}
|
||||
24
dataconnect/example/mutations.gql
Normal file
24
dataconnect/example/mutations.gql
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
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 })
|
||||
}
|
||||
67
dataconnect/example/queries.gql
Normal file
67
dataconnect/example/queries.gql
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
query ListMovies @auth(level: PUBLIC, insecureReason: "Anyone can list all movies.") {
|
||||
movies {
|
||||
id
|
||||
title
|
||||
imageUrl
|
||||
genre
|
||||
}
|
||||
}
|
||||
|
||||
query ListUsers @auth(level: NO_ACCESS) {
|
||||
users {
|
||||
id
|
||||
username
|
||||
}
|
||||
}
|
||||
|
||||
query ListUserReviews @auth(level: USER) {
|
||||
user(key: { id_expr: "auth.uid" }) {
|
||||
id
|
||||
username
|
||||
reviews: reviews_on_user {
|
||||
rating
|
||||
reviewDate
|
||||
reviewText
|
||||
movie {
|
||||
id
|
||||
title
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
query GetMovieById($id: UUID!) @auth(level: PUBLIC, insecureReason: "Anyone can get a movie by id.") {
|
||||
movie(id: $id) {
|
||||
id
|
||||
title
|
||||
imageUrl
|
||||
genre
|
||||
metadata: movieMetadata_on_movie {
|
||||
rating
|
||||
releaseYear
|
||||
description
|
||||
}
|
||||
reviews: reviews_on_movie {
|
||||
reviewText
|
||||
reviewDate
|
||||
rating
|
||||
user {
|
||||
id
|
||||
username
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
query SearchMovie($titleInput: String, $genre: String) @auth(level: PUBLIC, insecureReason: "Anyone can search for movies.") {
|
||||
movies(
|
||||
where: {
|
||||
_and: [{ genre: { eq: $genre } }, { title: { contains: $titleInput } }]
|
||||
}
|
||||
) {
|
||||
id
|
||||
title
|
||||
genre
|
||||
imageUrl
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue