Skip to content

Commit

Permalink
chore: updated Hasura metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
RiccardoM committed Feb 2, 2024
1 parent ff20c6c commit 8932046
Show file tree
Hide file tree
Showing 18 changed files with 100 additions and 158 deletions.
1 change: 1 addition & 0 deletions hasura/metadata/backend_configs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
6 changes: 3 additions & 3 deletions hasura/metadata/databases/databases.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
- name: athena
- name: djuno
kind: postgres
configuration:
connection_info:
use_prepared_statements: false
database_url:
from_env: HASURA_GRAPHQL_DATABASE_URL
isolation_level: read-committed
use_prepared_statements: false
tables: "!include athena/tables/tables.yaml"
tables: "!include djuno/tables/tables.yaml"
Original file line number Diff line number Diff line change
@@ -1,32 +1,25 @@
table:
name: application_link
schema: public
name: application_link
object_relationships:
- name: oracle_request
using:
manual_configuration:
column_mapping:
id: application_link_id
insertion_order: null
remote_table:
name: application_link_oracle_request
schema: public
name: application_link_oracle_request
insertion_order: null
column_mapping:
id: application_link_id
- name: profile
using:
manual_configuration:
column_mapping:
user_address: address
insertion_order: null
remote_table:
name: profile
schema: public
- name: score
using:
foreign_key_constraint_on:
column: application_link_row_id
table:
name: application_link_score
schema: public
name: profile
insertion_order: null
column_mapping:
user_address: address
select_permissions:
- role: anonymous
permission:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
table:
name: application_link_oracle_request
schema: public
object_relationships:
- name: application_link
using:
foreign_key_constraint_on: application_link_id
name: application_link_oracle_request
select_permissions:
- role: anonymous
permission:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
table:
name: application_link_score
schema: public
name: application_link_score
select_permissions:
- role: anonymous
permission:
Expand Down
2 changes: 1 addition & 1 deletion hasura/metadata/databases/djuno/tables/public_block.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
table:
name: block
schema: public
name: block
20 changes: 10 additions & 10 deletions hasura/metadata/databases/djuno/tables/public_chain_link.yaml
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
table:
name: chain_link
schema: public
name: chain_link
object_relationships:
- name: chain_config
using:
foreign_key_constraint_on: chain_config_id
- name: profile
using:
manual_configuration:
column_mapping:
user_address: address
insertion_order: null
remote_table:
name: profile
schema: public
name: profile
insertion_order: null
column_mapping:
user_address: address
- name: proof
using:
manual_configuration:
column_mapping:
id: chain_link_id
insertion_order: null
remote_table:
name: chain_link_proof
schema: public
name: chain_link_proof
insertion_order: null
column_mapping:
id: chain_link_id
array_relationships:
- name: chain_link_proofs
using:
foreign_key_constraint_on:
column: chain_link_id
table:
name: chain_link_proof
schema: public
name: chain_link_proof
select_permissions:
- role: anonymous
permission:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
table:
name: chain_link_chain_config
schema: public
name: chain_link_chain_config
array_relationships:
- name: chain_links
using:
foreign_key_constraint_on:
column: chain_config_id
table:
name: chain_link
schema: public
name: chain_link
select_permissions:
- role: anonymous
permission:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
table:
name: chain_link_proof
schema: public
name: chain_link_proof
object_relationships:
- name: chain_link
using:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
table:
name: dtag_transfer_requests
schema: public
name: dtag_transfer_requests
object_relationships:
- name: receiver
using:
manual_configuration:
column_mapping:
receiver_address: address
insertion_order: null
remote_table:
name: profile
schema: public
name: profile
insertion_order: null
column_mapping:
receiver_address: address
- name: sender
using:
manual_configuration:
column_mapping:
sender_address: address
insertion_order: null
remote_table:
name: profile
schema: public
name: profile
insertion_order: null
column_mapping:
sender_address: address
select_permissions:
- role: anonymous
permission:
Expand Down
14 changes: 1 addition & 13 deletions hasura/metadata/databases/djuno/tables/public_poll_answer.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
table:
name: poll_answer
schema: public
object_relationships:
- name: post_attachment
using:
foreign_key_constraint_on: attachment_row_id
select_permissions:
- role: anonymous
permission:
columns:
- answers_indexes
- user_address
filter: {}
allow_aggregations: true
name: poll_answer
80 changes: 40 additions & 40 deletions hasura/metadata/databases/djuno/tables/public_profile.yaml
Original file line number Diff line number Diff line change
@@ -1,70 +1,52 @@
table:
name: profile
schema: public
name: profile
array_relationships:
- name: applications_links
using:
manual_configuration:
column_mapping:
address: user_address
insertion_order: null
remote_table:
name: application_link
schema: public
name: application_link
insertion_order: null
column_mapping:
address: user_address
- name: chain_links
using:
manual_configuration:
column_mapping:
address: user_address
insertion_order: null
remote_table:
name: chain_link
schema: public
- name: default_chain_links
using:
manual_configuration:
name: chain_link
insertion_order: null
column_mapping:
address: user_address
insertion_order: null
remote_table:
name: default_chain_link
schema: public
- name: followage
- name: incoming_dtag_transfer_requests
using:
manual_configuration:
column_mapping:
address: counterparty_address
insertion_order: null
remote_table:
name: user_relationship
schema: public
- name: following
using:
manual_configuration:
column_mapping:
address: creator_address
name: dtag_transfer_requests
insertion_order: null
remote_table:
name: user_relationship
schema: public
- name: incoming_dtag_transfer_requests
using:
manual_configuration:
column_mapping:
address: receiver_address
insertion_order: null
remote_table:
name: dtag_transfer_requests
schema: public
- name: outgoing_dtag_transfer_requests
using:
manual_configuration:
column_mapping:
address: sender_address
insertion_order: null
remote_table:
name: dtag_transfer_requests
schema: public
name: dtag_transfer_requests
insertion_order: null
column_mapping:
address: sender_address
computed_fields:
- name: is_user_following
definition:
function:
schema: public
name: is_user_following_profile
session_argument: hasura_session
table_argument: profile_row
comment: A computed field that tells whether the current Hasura user is following this profile
select_permissions:
- role: anonymous
permission:
Expand All @@ -76,5 +58,23 @@ select_permissions:
- dtag
- nickname
- profile_pic
computed_fields:
- is_user_following
filter: {}
limit: 20
allow_aggregations: true
- role: user
permission:
columns:
- address
- bio
- cover_pic
- creation_time
- dtag
- nickname
- profile_pic
computed_fields:
- is_user_following
filter: {}
limit: 100
allow_aggregations: true
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
table:
name: profiles_params
schema: public
name: profiles_params
select_permissions:
- role: anonymous
permission:
Expand Down
22 changes: 9 additions & 13 deletions hasura/metadata/databases/djuno/tables/public_user_block.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
table:
name: user_block
schema: public
name: user_block
object_relationships:
- name: blocked
using:
manual_configuration:
column_mapping:
blocked_address: address
insertion_order: null
remote_table:
name: profile
schema: public
name: profile
insertion_order: null
column_mapping:
blocked_address: address
- name: blocker
using:
manual_configuration:
column_mapping:
blocker_address: address
insertion_order: null
remote_table:
name: profile
schema: public
- name: subspace
using:
foreign_key_constraint_on: subspace_id
name: profile
insertion_order: null
column_mapping:
blocker_address: address
select_permissions:
- role: anonymous
permission:
Expand All @@ -32,4 +29,3 @@ select_permissions:
- reason
- subspace_id
filter: {}
limit: 50
Loading

0 comments on commit 8932046

Please sign in to comment.