Skip to content

Commit

Permalink
add query user public api
Browse files Browse the repository at this point in the history
  • Loading branch information
harisato committed Sep 18, 2023
1 parent 42fcb07 commit 7572153
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ select_permissions:
- role: anonymous
permission:
columns:
- bio
- birthdate
- email
- gender
- id
- nickname
- picture
Expand Down
131 changes: 72 additions & 59 deletions hasura/metadata/query_collections.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -663,65 +663,6 @@
}
}
}
- name: Public - Query creator by id
query: |
query QueryCreatorById ($id: Int!) {
creators(where: {id:{_eq:$id}}) {
id
avatar_url
bio
dob
gender
name
pen_name
socials
total_subscribers
isActive
created_at
manga_creators {
manga {
id
status
poster
banner
manga_creators {
creator {
name
pen_name
id
}
}
manga_total_likes {
likes
}
manga_total_views {
views
}
manga_tags {
tag {
tag_languages {
language_id
value
}
id
}
}
chapters(limit: 1, order_by: {chapter_number:desc}, where: {status:{_eq:"Published"}}) {
id
chapter_number
chapter_name
}
contract_addresses
manga_languages {
id
is_main_language
title
description
}
}
}
}
}
- name: Public - Get manga detail
query: |
query GetMangaReadingDetail ($id: Int = 1, $user_id: bpchar = "") {
Expand Down Expand Up @@ -794,3 +735,75 @@
}
}
}
- name: Public - Query creator by id
query: |
query QueryCreatorById ($id: Int!) {
creators(where: {id:{_eq:$id}}) {
id
avatar_url
bio
dob
gender
name
pen_name
socials
total_subscribers
isActive
created_at
manga_creators(where: {manga:{status:{_neq:"Removed"}}}) {
manga {
id
status
poster
banner
manga_creators {
creator {
name
pen_name
id
}
}
manga_total_likes {
likes
}
manga_total_views {
views
}
manga_tags {
tag {
tag_languages {
language_id
value
}
id
}
}
chapters(limit: 1, order_by: {chapter_number:desc}, where: {status:{_eq:"Published"}}) {
id
chapter_number
chapter_name
}
contract_addresses
manga_languages {
id
is_main_language
title
description
}
}
}
}
}
- name: Public - Query User
query: |
query QueryUser ($user_id: bpchar = "") {
authorizer_users(where: {id:{_eq:$user_id}}) {
id
email
nickname
birthdate
bio
picture
gender
}
}
9 changes: 9 additions & 0 deletions hasura/metadata/rest_endpoints.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,15 @@
- GET
name: Public - Get trending manga
url: public/trending
- comment: ""
definition:
query:
collection_name: allowed-queries
query_name: Public - Query User
methods:
- GET
name: Public - Query User
url: public/users/:user_id
- comment: ""
definition:
query:
Expand Down

0 comments on commit 7572153

Please sign in to comment.