Skip to content

Commit

Permalink
feat(hasura): update api
Browse files Browse the repository at this point in the history
  • Loading branch information
harisato committed Jul 28, 2023
1 parent aaf9e35 commit ba652d6
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ select_permissions:
- detail
- id
- language_id
filter: {}
filter:
chapter:
status:
_eq: Free
allow_aggregations: true
- role: user
permission:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ select_permissions:
- updated_at
- views
filter: {}
limit: 20
allow_aggregations: true
- role: user
permission:
Expand All @@ -73,5 +72,4 @@ select_permissions:
- updated_at
- views
filter: {}
limit: 19
allow_aggregations: true
68 changes: 34 additions & 34 deletions hasura/metadata/query_collections.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -448,40 +448,6 @@
}
}
}
- name: Public - Get chapter detail
query: |
query GetChapterReadingDetail ($manga_id: Int = 18, $chapter_number: Int = 1, $user_id: String = "") {
chapters(where: {_and:{chapter_number:{_eq:$chapter_number},manga:{_and:{id:{_eq:$manga_id},_or:[{status:{_ilike:"On-going"}},{status:{_eq:"Finished"}}]}},status:{_eq:"Published"}}}) {
id
chapter_number
chapter_name
chapter_type
thumbnail_url
status
pushlish_date
chapter_languages {
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: Admin - Update manga
query: |
mutation UpdateManga ($manga_id: Int!, $status: String!, $banner: String!, $poster: String!, $manga_languages: [manga_languages_insert_input!] = {language_id:10,is_main_language:false,description:"",title:""}, $manga_creators: [manga_creator_insert_input!] = {creator_id:10}, $manga_tags: [manga_tag_insert_input!] = {tag_id:10}, $release_date: timestamptz = "") {
Expand Down Expand Up @@ -841,3 +807,37 @@
poster
}
}
- name: Public - Get chapter detail
query: |
query GetChapterReadingDetail ($manga_id: Int = 18, $chapter_number: Int = 1, $user_id: String = "") {
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
}
}
}

0 comments on commit ba652d6

Please sign in to comment.