Skip to content

Commit a5f9119

Browse files
authored
Set @auth(insecureReason) in init template (#8863)
* Set @auth(insecureReason) in init template * fix * Update mutations.gql
1 parent 783007a commit a5f9119

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

templates/init/dataconnect/mutations.gql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# # Create a movie based on user input
44
# mutation CreateMovie($title: String!, $genre: String!, $imageUrl: String!)
5-
# @auth(level: USER_EMAIL_VERIFIED) {
5+
# @auth(level: USER_EMAIL_VERIFIED, insecureReason: "Any email verified users can create a new movie.") {
66
# movie_insert(data: { title: $title, genre: $genre, imageUrl: $imageUrl })
77
# }
88

templates/init/dataconnect/queries.gql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# # @auth() directives control who can call each operation.
44
# # Anyone should be able to list all movies, so the auth level is set to PUBLIC
5-
# query ListMovies @auth(level: PUBLIC) {
5+
# query ListMovies @auth(level: PUBLIC, insecureReason: "Anyone can list all movies.") {
66
# movies {
77
# id
88
# title
@@ -40,7 +40,7 @@
4040
# }
4141

4242
# # Get movie by id
43-
# query GetMovieById($id: UUID!) @auth(level: PUBLIC) {
43+
# query GetMovieById($id: UUID!) @auth(level: PUBLIC, insecureReason: "Anyone can get a movie by id.") {
4444
# movie(id: $id) {
4545
# id
4646
# title
@@ -64,7 +64,7 @@
6464
# }
6565

6666
# # Search for movies, actors, and reviews
67-
# query SearchMovie($titleInput: String, $genre: String) @auth(level: PUBLIC) {
67+
# query SearchMovie($titleInput: String, $genre: String) @auth(level: PUBLIC, insecureReason: "Anyone can search for movies.") {
6868
# movies(
6969
# where: {
7070
# _and: [{ genre: { eq: $genre } }, { title: { contains: $titleInput } }]

0 commit comments

Comments
 (0)