Skip to content

Commit

Permalink
feat(hasura): query manga by slug
Browse files Browse the repository at this point in the history
  • Loading branch information
harisato committed Oct 3, 2023
1 parent 38a5f2c commit 8472d49
Showing 1 changed file with 107 additions and 107 deletions.
214 changes: 107 additions & 107 deletions hasura/metadata/query_collections.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -217,40 +217,6 @@
}
}
}
- name: Public - Get chapter detail
query: |
query GetChapterReadingDetail ($manga_id: Int = 18, $chapter_number: Int = 1, $user_id: bpchar = "") {
chapters(where: {_and:{chapter_number:{_eq:$chapter_number},manga:{_and:{id:{_eq:$manga_id},_or:[{status:{_ilike:"On-going"}},{status:{_eq:"Finished"}}]}}}}) {
id
chapter_number
chapter_name
chapter_type
thumbnail_url
status
pushlish_date
chapter_languages(where: {chapter:{status:{_eq:"Published"}}}) {
language_id
detail
}
comments: social_activities_aggregate {
aggregate {
count
}
}
views
chapters_likes_aggregate {
aggregate {
count
}
}
chapters_likes(where: {user_id:{_eq:$user_id}}) {
id
created_at
user_id
chapter_id
}
}
}
- name: Public - Get Chapter Comments
query: |
query GetChapterComments ($chapter_id: Int!) {
Expand Down Expand Up @@ -607,79 +573,6 @@
}
}
}
- name: Public - Get manga detail
query: |
query GetMangaReadingDetail ($id: Int = 1, $user_id: bpchar = "") {
manga(where: {_and:{id:{_eq:$id},status:{_neq:"Removed"}}}) {
id
slug
poster
banner
contract_addresses
status
release_date
manga_creators {
creator {
id
name
pen_name
isActive
}
}
manga_total_likes {
likes
}
manga_total_views {
views
}
manga_languages {
title
description
is_main_language
language_id
}
chapters_aggregate {
aggregate {
count
}
}
chapters(order_by: {chapter_number:desc_nulls_last}, where: {status:{_neq:"Inactive"}}) {
id
chapter_number
chapter_name
chapter_type
thumbnail_url
pushlish_date
status
views
chapter_total_likes {
likes
}
chapters_likes(where: {user_id:{_eq:$user_id}}) {
id
created_at
}
}
manga_subscribers_aggregate {
aggregate {
count
}
}
manga_tags(limit: 5) {
tag {
id
tag_languages {
language_id
value
}
}
}
manga_subscribers(where: {user_id:{_eq:$user_id}}) {
id
created_at
}
}
}
- name: Public - Search manga
query: |
query SearchManga ($text: String = "%%") {
Expand Down Expand Up @@ -820,3 +713,110 @@
}
}
}
- name: Public - Get manga detail
query: |
query GetMangaReadingDetail ($user_id: bpchar = "", $slug: String = "") {
manga(where: {_and:{slug:{_eq:$slug},status:{_neq:"Removed"}}}) {
id
slug
poster
banner
contract_addresses
status
release_date
manga_creators {
creator {
id
name
pen_name
isActive
}
}
manga_total_likes {
likes
}
manga_total_views {
views
}
manga_languages {
title
description
is_main_language
language_id
}
chapters_aggregate {
aggregate {
count
}
}
chapters(order_by: {chapter_number:desc_nulls_last}, where: {status:{_neq:"Inactive"}}) {
id
chapter_number
chapter_name
chapter_type
thumbnail_url
pushlish_date
status
views
chapter_total_likes {
likes
}
chapters_likes(where: {user_id:{_eq:$user_id}}) {
id
created_at
}
}
manga_subscribers_aggregate {
aggregate {
count
}
}
manga_tags(limit: 5) {
tag {
id
tag_languages {
language_id
value
}
}
}
manga_subscribers(where: {user_id:{_eq:$user_id}}) {
id
created_at
}
}
}
- name: Public - Get chapter detail
query: |
query GetChapterReadingDetail ($slug: String, $chapter_number: Int = 1, $user_id: bpchar = "") {
chapters(where: {_and:{chapter_number:{_eq:$chapter_number},manga:{_and:{slug:{_eq:$slug},_or:[{status:{_ilike:"On-going"}},{status:{_eq:"Finished"}}]}}}}) {
id
chapter_number
chapter_name
chapter_type
thumbnail_url
status
pushlish_date
chapter_languages(where: {chapter:{status:{_eq:"Published"}}}) {
language_id
detail
}
comments: social_activities_aggregate {
aggregate {
count
}
}
views
chapters_likes_aggregate {
aggregate {
count
}
}
chapters_likes(where: {user_id:{_eq:$user_id}}) {
id
created_at
user_id
chapter_id
}
}
}

0 comments on commit 8472d49

Please sign in to comment.