Skip to content

Commit

Permalink
fixed top user donate
Browse files Browse the repository at this point in the history
  • Loading branch information
Xoai committed Oct 1, 2024
1 parent ec1578c commit 3402347
Show file tree
Hide file tree
Showing 11 changed files with 182 additions and 233 deletions.
43 changes: 0 additions & 43 deletions hasura/metadata/databases/punkga-pg/tables/public_albums.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,46 +9,3 @@ array_relationships:
table:
name: artworks
schema: public
select_permissions:
- role: anonymous
permission:
columns:
- created_at
- creator_id
- description
- disable
- id
- name
- show
- thumbnail_url
- updated_at
filter: {}
allow_aggregations: true
- role: creator
permission:
columns:
- created_at
- creator_id
- description
- disable
- id
- name
- show
- thumbnail_url
- updated_at
filter: {}
allow_aggregations: true
- role: user
permission:
columns:
- created_at
- creator_id
- description
- disable
- id
- name
- show
- thumbnail_url
- updated_at
filter: {}
allow_aggregations: true
20 changes: 1 addition & 19 deletions hasura/metadata/databases/punkga-pg/tables/public_artworks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,23 @@ select_permissions:
- role: anonymous
permission:
columns:
- album_id
- contest_id
- contest_round
- created_at
- creator_id
- id
- name
- source_url
- updated_at
- url
filter: {}
allow_aggregations: true
- role: creator
permission:
columns:
- album_id
- contest_id
- contest_round
- creator_id
- id
- name
- source_url
- url
- created_at
- updated_at
filter: {}
allow_aggregations: true
- role: user
permission:
columns:
- album_id
- contest_id
- contest_round
- creator_id
- id
- name
- source_url
- url
- created_at
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ select_permissions:
- revoked_timestamp
- roles
- signup_methods
- ton_wallet_address
- updated_at
- wallet_address
computed_fields:
Expand All @@ -110,7 +109,6 @@ update_permissions:
- gender
- nickname
- picture
- ton_wallet_address
- wallet_address
filter:
id:
Expand Down
261 changes: 111 additions & 150 deletions hasura/metadata/query_collections.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1077,6 +1077,117 @@
}
}
}
- name: User - Get Profile
query: |
query GetUserProfile {
authorizer_users(limit: 1) {
id
email
email_verified_at
bio
birthdate
gender
active_wallet_address: active_evm_address
wallet_address
nickname
picture
signup_methods
levels {
xp
level
user_level_chain {
id
name
punkga_config
}
}
authorizer_users_user_wallet {
address
}
user_quests_aggregate {
aggregate {
count
}
}
user_quests(order_by: {created_at:desc}, limit: 20) {
created_at
status
user_quest_rewards {
tx_hash
}
quest {
id
name
quests_campaign {
campaign_chain {
punkga_config
}
}
quests_i18n {
id
quest_id
language_id
data
i18n_language {
id
description
icon
is_main
symbol
}
}
reward
}
}
}
}
- name: Public - Get manga by creator
query: |
query manga ($id: Int!, $limit: Int = 10, $offset: Int = 0) {
manga(limit: $limit, offset: $offset, where: {manga_creators:{creator_id:{_eq:$id}},status:{_neq:"Removed"}}) {
id
slug
status
poster
banner
manga_creators {
creator {
name
pen_name
id
slug
}
}
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
language_id
}
}
}
- name: Public - query artwork by creator
query: |
query artworks ($creator_id: Int!, $limit: Int = 10, $offset: Int = 0) {
Expand Down Expand Up @@ -1320,153 +1431,3 @@
}
}
}
- name: Public - Query albums by creator id
query: |
query albums ($creator_id: Int!, $limit: Int = 100, $offset: Int = 0) {
albums(where: {_or:[{_and:{id:{_eq:1},show:{_eq:true}}},{_and:{creator_id:{_eq:$creator_id},show:{_eq:true}}}]}, limit: $limit, offset: $offset) {
id
show
thumbnail_url
name
disable
}
albums_aggregate(where: {_or:[{_and:{id:{_eq:1},show:{_eq:true}}},{_and:{creator_id:{_eq:$creator_id},show:{_eq:true}}}]}) {
aggregate {
count
}
}
}
- name: Public - Query album detail
query: |
query albums ($id: Int!, $limit: Int = 10, $offset: Int = 0, $creator_id: Int!) {
albums(where: {id:{_eq:$id},show:{_eq:true},disable:{_eq:false}}) {
id
name
thumbnail_url
show
disable
artworks(limit: $limit, offset: $offset, where: {creator_id:{_eq:$creator_id}}) {
id
name
url
}
artworks_aggregate(where: {creator_id:{_eq:$creator_id}}) {
aggregate {
count
}
}
}
}
- name: Public - Get manga by creator
query: |
query manga ($id: Int!, $limit: Int = 10, $offset: Int = 0) {
manga(limit: $limit, offset: $offset, where: {manga_creators:{creator_id:{_eq:$id}},status:{_neq:"Removed"}}) {
id
slug
status
poster
banner
manga_creators {
creator {
name
pen_name
id
slug
isActive
}
}
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
language_id
}
}
}
- name: User - Get Profile
query: |
query GetUserProfile {
authorizer_users(limit: 1) {
id
email
email_verified_at
bio
birthdate
gender
active_wallet_address: active_evm_address
wallet_address
ton_wallet_address
nickname
picture
signup_methods
levels {
xp
level
user_level_chain {
id
name
punkga_config
}
}
authorizer_users_user_wallet {
address
}
user_quests_aggregate {
aggregate {
count
}
}
user_quests(order_by: {created_at:desc}, limit: 20) {
created_at
status
user_quest_rewards {
tx_hash
}
quest {
id
name
quests_campaign {
campaign_chain {
punkga_config
}
}
quests_i18n {
id
quest_id
language_id
data
i18n_language {
id
description
icon
is_main
symbol
}
}
reward
}
}
}
}
Loading

0 comments on commit 3402347

Please sign in to comment.