Skip to content

Commit

Permalink
feat(hasura): update query creator api
Browse files Browse the repository at this point in the history
  • Loading branch information
harisato committed Aug 31, 2023
1 parent 87726f6 commit aae2199
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 44 deletions.
5 changes: 4 additions & 1 deletion conf-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,7 @@ authorizer:
google:
analytics:
propertyId: 'xxxxxxxxx'
keyFile: './credentials/xxxxxx-xxx-xxxxxxxxxxxx.json'
keyFile: './credentials/xxxxxx-xxx-xxxxxxxxxxxx.json'
horosope:
endpoint: https://indexer-v2.staging.aurascan.io/api/v2/graphql
network: euphoria
62 changes: 28 additions & 34 deletions hasura/metadata/query_collections.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -330,40 +330,6 @@
}
}
}
- 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 = "") {
delete_manga_tag(where: {manga_id:{_eq:$manga_id}}) {
affected_rows
}
delete_manga_creator(where: {manga_id:{_eq:$manga_id}}) {
affected_rows
}
delete_manga_languages(where: {manga_id:{_eq:$manga_id}}) {
affected_rows
}
insert_manga_one(object: {status:$status,manga_creators:{data:$manga_creators},banner:$banner,poster:$poster,manga_languages:{data:$manga_languages},manga_tags:{data:$manga_tags},id:$manga_id,release_date:$release_date}, on_conflict: {constraint:manga_pkey,update_columns:[banner,poster,status,release_date]}) {
id
banner
poster
status
release_date
created_at
status
manga_creators {
creator_id
}
manga_languages {
language_id
title
is_main_language
description
}
manga_tags {
tag_id
}
}
}
- name: Public - Search manga
query: |
query SearchManga ($text: String = "%%") {
Expand Down Expand Up @@ -901,7 +867,35 @@
created_at
manga_creators {
manga {
id
status
manga_total_likes {
likes
}
manga_total_views {
views
}
manga_tags {
tag {
tag_languages {
language_id
value
}
id
}
}
chapters(order_by: {chapter_number:desc}, limit: 1) {
id
chapter_number
chapter_name
}
contract_addresses
manga_languages {
id
is_main_language
title
description
}
}
}
}
Expand Down
9 changes: 0 additions & 9 deletions hasura/metadata/rest_endpoints.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -259,15 +259,6 @@
- GET
name: Public - Query creator by id
url: creators/:id
- comment: ""
definition:
query:
collection_name: allowed-queries
query_name: Admin - Update manga
methods:
- PUT
name: Admin - Update manga
url: manga/:manga_id
- comment: ""
definition:
query:
Expand Down

0 comments on commit aae2199

Please sign in to comment.