Skip to content

Commit 396974f

Browse files
authoredDec 12, 2024··
Fixed Apollo API (#908)
* fix: added delegation votes to schema * fix: upgraded docker version in docker-compose.yml * fix: correct casing of delegationvotes * fix: added missing types * fix: updated graphql schema * chore: cleaned up schema.graphql - Issue still not fixed yet * stashing * stashing * fix: updating tables and setting right permissions * fix: updating schema.graphql not done yet * fixed schema * fix: schema.graphql * chore: reverted dev changes
1 parent c6aa33c commit 396974f

30 files changed

+2364
-1471
lines changed
 

‎.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ lerna-debug.log
1010
result*
1111
*yarn-error.log
1212
bin
13-
state
13+
state
14+
packages-cache/**

‎packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_DelegationVote.yaml

+5-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ configuration:
55
column_config: {}
66
custom_column_names: {}
77
custom_root_fields:
8-
select: delegationvotes
9-
select_aggregate: delegationvotes_aggregate
8+
select: delegationVotes
9+
select_aggregate: delegationVotes_aggregate
1010
object_relationships:
1111
- name: redeemer
1212
using:
@@ -40,6 +40,9 @@ select_permissions:
4040
permission:
4141
columns:
4242
- address
43+
- drep_hash_id
44+
- tx_id
45+
- redeemerId
4346
filter: {}
4447
limit: 2500
4548
allow_aggregations: true

‎packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_DrepRegistration.yaml

+12-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,15 @@ object_relationships:
2525
insertion_order: null
2626
remote_table:
2727
name: voting_anchor
28-
schema: public
28+
schema: public
29+
select_permissions:
30+
- role: cardano-graphql
31+
permission:
32+
columns:
33+
- DRepId
34+
- deposit
35+
- tx_id
36+
- voting_anchor_id
37+
filter: {}
38+
limit: 2500
39+
allow_aggregations: true

‎packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_committee.yaml

+21-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,24 @@ object_relationships:
1010
insertion_order: null
1111
remote_table:
1212
name: committee_member
13-
schema: public
13+
schema: public
14+
- name: govActionProposal
15+
using:
16+
manual_configuration:
17+
column_mapping:
18+
gov_action_proposal_id: id
19+
insertion_order: null
20+
remote_table:
21+
name: gov_action_proposal
22+
schema: public
23+
select_permissions:
24+
- role: cardano-graphql
25+
permission:
26+
columns:
27+
- gov_action_proposal_id
28+
- quorum_denominator
29+
- quorum_numerator
30+
- id
31+
filter: {}
32+
limit: 2500
33+
allow_aggregations: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
table:
2+
name: committee_de_registration
3+
schema: public
4+
configuration:
5+
column_config: {}
6+
custom_column_names: {}
7+
custom_root_fields:
8+
select: committeeDeRegistration
9+
select_aggregate: committeeDeRegistration_aggregate
10+
object_relationships:
11+
- name: transaction
12+
using:
13+
manual_configuration:
14+
column_mapping:
15+
tx_id: id
16+
insertion_order: null
17+
remote_table:
18+
name: Transaction
19+
schema: public
20+
- name: votingAnchor
21+
using:
22+
manual_configuration:
23+
column_mapping:
24+
voting_anchor_id: id
25+
remote_table:
26+
name: voting_anchor
27+
schema: public
28+
select_permissions:
29+
- role: cardano-graphql
30+
permission:
31+
columns:
32+
- cert_index
33+
- cold_key_id
34+
- tx_id
35+
- voting_anchor_id
36+
filter: {}
37+
limit: 2500
38+
allow_aggregations: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
table:
2+
name: committee_hash
3+
schema: public
4+
configuration:
5+
column_config: {}
6+
custom_column_names: {}
7+
custom_root_fields:
8+
select: committeeHash
9+
select_aggregate: committeeHash_aggregate
10+
select_permissions:
11+
- role: cardano-graphql
12+
permission:
13+
columns:
14+
- has_script
15+
- raw
16+
filter: {}
17+
limit: 2500
18+
allow_aggregations: true

‎packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_committee_member.yaml ‎packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_committeeMember.yaml

+18-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
table:
22
name: committee_member
33
schema: public
4+
configuration:
5+
column_config: {}
6+
custom_column_names: {}
7+
custom_root_fields:
8+
select: committeeMember
9+
select_aggregate: committeeMember_aggregate
410
object_relationships:
511
- name: committee
612
using:
@@ -18,4 +24,15 @@ object_relationships:
1824
committee_hash_id: id
1925
remote_table:
2026
name: committee_hash
21-
schema: public
27+
schema: public
28+
select_permissions:
29+
- role: cardano-graphql
30+
permission:
31+
columns:
32+
- committee_hash_id
33+
- committee_id
34+
- expiration_epoch
35+
- id
36+
filter: {}
37+
limit: 2500
38+
allow_aggregations: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
table:
2+
name: committee_registration
3+
schema: public
4+
configuration:
5+
column_config: {}
6+
custom_column_names: {}
7+
custom_root_fields:
8+
select: committeeRegistration
9+
select_aggregate: committeeRegistration_aggregate
10+
object_relationships:
11+
- name: transaction
12+
using:
13+
manual_configuration:
14+
column_mapping:
15+
tx_id: id
16+
insertion_order: null
17+
remote_table:
18+
name: Transaction
19+
schema: public
20+
select_permissions:
21+
- role: cardano-graphql
22+
permission:
23+
columns:
24+
- cert_index
25+
- cold_key_id
26+
- hot_key_id
27+
- tx_id
28+
filter: {}
29+
limit: 2500
30+
allow_aggregations: true

‎packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_committee_de_registration.yaml

-21
This file was deleted.

‎packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_committee_hash.yaml

-3
This file was deleted.

‎packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_committee_registration.yaml

-13
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
table:
2+
name: drep_hash
3+
schema: public
4+
configuration:
5+
column_config: {}
6+
custom_column_names: {}
7+
custom_root_fields:
8+
select: drepHash
9+
select_aggregate: drepHash_aggregate
10+
select_permissions:
11+
- role: cardano-graphql
12+
permission:
13+
columns:
14+
- view
15+
- has_script
16+
- raw
17+
filter: { }
18+
allow_aggregations: true

‎packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_drep_hash.yaml

-3
This file was deleted.

‎packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_gov_action_proposal.yaml ‎packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_govActionProposal.yaml

+19-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ configuration:
55
column_config: {}
66
custom_column_names: {}
77
custom_root_fields:
8-
select: gov_action_proposal
9-
select_aggregate: gov_action_proposal_aggregate
8+
select: govActionProposal
9+
select_aggregate: govActionProposal_aggregate
1010
object_relationships:
1111
- name: transaction
1212
using:
@@ -32,4 +32,20 @@ object_relationships:
3232
voting_anchor_id: id
3333
remote_table:
3434
name: voting_anchor
35-
schema: public
35+
schema: public
36+
select_permissions:
37+
- role: cardano-graphql
38+
permission:
39+
columns:
40+
- tx_id
41+
- index
42+
- prev_gov_action_proposal
43+
- deposit
44+
- return_address
45+
- expiration
46+
- voting_anchor_id
47+
- type
48+
- description
49+
filter: {}
50+
limit: 2500
51+
allow_aggregations: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
table:
2+
name: off_chain_vote_author
3+
schema: public
4+
configuration:
5+
column_config: {}
6+
custom_column_names: {}
7+
custom_root_fields:
8+
select: offChainVoteAuthor
9+
select_aggregate: offChainVoteAuthor_aggregate
10+
object_relationships:
11+
- name: offChainVoteData
12+
using:
13+
manual_configuration:
14+
column_mapping:
15+
off_chain_vote_data_id: id
16+
remote_table:
17+
name: off_chain_vote_data
18+
schema: public
19+
select_permissions:
20+
- role: cardano-graphql
21+
permission:
22+
columns:
23+
- name
24+
- off_chain_vote_data_id
25+
- public_key
26+
- signature
27+
- warning
28+
- witness_algorithm
29+
filter: {}
30+
limit: 2500
31+
allow_aggregations: true
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,56 @@
11
table:
22
name: off_chain_vote_data
33
schema: public
4+
configuration:
5+
column_config: {}
6+
custom_column_names: {}
7+
custom_root_fields:
8+
select: offChainVoteData
9+
select_aggregate: offChainVoteData_aggregate
410
object_relationships:
5-
- name: OffChainVoteGovActionData
11+
- name: offChainVoteGovActionData
612
using:
713
manual_configuration:
814
column_mapping:
915
id: off_chain_vote_data_id
1016
remote_table:
1117
name: off_chain_vote_gov_action_data
1218
schema: public
13-
- name: OffChainDrepData
19+
- name: offChainVoteDrepData
1420
using:
1521
manual_configuration:
1622
column_mapping:
1723
id: off_chain_vote_data_id
1824
remote_table:
1925
name: off_chain_vote_drep_data
2026
schema: public
21-
- name: OffChainVoteAuthor
27+
- name: offChainVoteAuthor
2228
using:
2329
manual_configuration:
2430
column_mapping:
2531
id: off_chain_vote_data_id
2632
remote_table:
2733
name: off_chain_vote_author
2834
schema: public
29-
- name: OffChainVoteReference
35+
- name: ofChainVoteReference
3036
using:
3137
manual_configuration:
3238
column_mapping:
3339
id: off_chain_vote_data_id
3440
remote_table:
3541
name: off_chain_vote_reference
36-
schema: public
42+
schema: public
43+
select_permissions:
44+
- role: cardano-graphql
45+
permission:
46+
columns:
47+
- bytes
48+
- comment
49+
- hash
50+
- is_valid
51+
- json
52+
- voting_anchor_id
53+
- warning
54+
filter: {}
55+
limit: 2500
56+
allow_aggregations: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
table:
2+
name: off_chain_vote_drep_data
3+
schema: public
4+
configuration:
5+
column_config: {}
6+
custom_column_names: {}
7+
custom_root_fields:
8+
select: offChainVoteDrepData
9+
select_aggregate: offChainVoteDrepData_aggregate
10+
object_relationships:
11+
- name: offChainVoteData
12+
using:
13+
manual_configuration:
14+
column_mapping:
15+
off_chain_vote_data_id: id
16+
remote_table:
17+
name: off_chain_vote_data
18+
schema: public
19+
select_permissions:
20+
- role: cardano-graphql
21+
permission:
22+
columns:
23+
- given_name
24+
- image_hash
25+
- image_url
26+
- motivations
27+
- objectives
28+
- off_chain_vote_data_id
29+
- payment_address
30+
- qualifications
31+
filter: {}
32+
limit: 2500
33+
allow_aggregations: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
table:
2+
name: off_chain_vote_gov_action_data
3+
schema: public
4+
configuration:
5+
column_config: {}
6+
custom_column_names: {}
7+
custom_root_fields:
8+
select: offChainVoteGovActionData
9+
select_aggregate: offChainVoteGovActionData_aggregate
10+
object_relationships:
11+
- name: OffChainVoteData
12+
using:
13+
manual_configuration:
14+
column_mapping:
15+
off_chain_vote_data_id: id
16+
remote_table:
17+
name: off_chain_vote_data
18+
schema: public
19+
select_permissions:
20+
- role: cardano-graphql
21+
permission:
22+
columns:
23+
- abstract
24+
- motivation
25+
- off_chain_vote_data_id
26+
- rationale
27+
- title
28+
filter: {}
29+
limit: 2500
30+
allow_aggregations: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
table:
2+
name: off_chain_vote_reference
3+
schema: public
4+
configuration:
5+
column_config: {}
6+
custom_column_names: {}
7+
custom_root_fields:
8+
select: offChainVoteReference
9+
select_aggregate: offChainVoteReference_aggregate
10+
object_relationships:
11+
- name: OffChainVoteData
12+
using:
13+
manual_configuration:
14+
column_mapping:
15+
off_chain_vote_data_id: id
16+
remote_table:
17+
name: off_chain_vote_data
18+
schema: public
19+
select_permissions:
20+
- role: cardano-graphql
21+
permission:
22+
columns:
23+
- hash_algorithm
24+
- hash_digest
25+
- label
26+
- off_chain_vote_data_id
27+
- uri
28+
filter: {}
29+
limit: 2500
30+
allow_aggregations: true

‎packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_off_chain_vote_author.yaml

-12
This file was deleted.

‎packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_off_chain_vote_drep_data.yaml

-12
This file was deleted.

‎packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_off_chain_vote_gov_action_data.yaml

-12
This file was deleted.

‎packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_off_chain_vote_reference.yaml

-12
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
table:
2+
name: voting_anchor
3+
schema: public
4+
configuration:
5+
column_config: {}
6+
custom_column_names: {}
7+
custom_root_fields:
8+
select: votingAnchor
9+
select_aggregate: votingAnchor_aggregate
10+
object_relationships:
11+
- name: offChainData
12+
using:
13+
manual_configuration:
14+
column_mapping:
15+
id: voting_anchor_id
16+
insertion_order: null
17+
remote_table:
18+
name: off_chain_vote_data
19+
schema: public
20+
select_permissions:
21+
- role: cardano-graphql
22+
permission:
23+
columns:
24+
- block_id
25+
- data_hash
26+
- type
27+
- url
28+
filter: {}
29+
limit: 2500
30+
allow_aggregations: true

‎packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_voting_procedure.yaml ‎packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_votingProcedure.yaml

+26-9
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ configuration:
55
column_config: {}
66
custom_column_names: {}
77
custom_root_fields:
8-
select: vote_procedure
9-
select_aggregate: vote_procedure_aggregate
8+
select: voteProcedure
9+
select_aggregate: voteProcedure_aggregate
1010
object_relationships:
1111
- name: transaction
1212
using:
@@ -15,45 +15,62 @@ object_relationships:
1515
tx_id: id
1616
insertion_order: null
1717
remote_table:
18-
name: tx
18+
name: Transaction
1919
schema: public
20-
- name: GovActionProposal
20+
- name: govActionProposal
2121
using:
2222
manual_configuration:
2323
column_mapping:
2424
gov_action_proposal_id: id
2525
remote_table:
2626
name: gov_action_proposal
2727
schema: public
28-
- name: DrepVoter
28+
- name: drepVoter
2929
using:
3030
manual_configuration:
3131
column_mapping:
3232
drep_voter: id
3333
remote_table:
3434
name: drep_hash
3535
schema: public
36-
- name: PoolVoter
36+
- name: poolVoter
3737
using:
3838
manual_configuration:
3939
column_mapping:
4040
pool_voter: id
4141
remote_table:
4242
name: pool_hash
4343
schema: public
44-
- name: VotingAnchor
44+
- name: votingAnchor
4545
using:
4646
manual_configuration:
4747
column_mapping:
4848
voting_anchor_id: id
4949
remote_table:
5050
name: voting_anchor
5151
schema: public
52-
- name: CommitteeVoter
52+
- name: committeeVoter
5353
using:
5454
manual_configuration:
5555
column_mapping:
5656
committee_voter: id
5757
remote_table:
5858
name: committee_hash
59-
schema: public
59+
schema: public
60+
select_permissions:
61+
- role: cardano-graphql
62+
permission:
63+
columns:
64+
- committee_voter
65+
- drep_voter
66+
- gov_action_proposal_id
67+
- index
68+
- invalid
69+
- pool_voter
70+
- tx_id
71+
- vote
72+
- voter_role
73+
- voting_anchor_id
74+
filter: {}
75+
limit: 2500
76+
allow_aggregations: true

‎packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/public_voting_anchor.yaml

-13
This file was deleted.

‎packages/api-cardano-db-hasura/hasura/project/metadata/databases/default/tables/tables.yaml

+14-14
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,21 @@
3535
- "!include public_pool_stat.yaml"
3636
- "!include public_DelegationVote.yaml"
3737
- "!include public_DrepRegistration.yaml"
38-
- "!include public_drep_hash.yaml"
39-
- "!include public_voting_anchor.yaml"
40-
- "!include public_voting_procedure.yaml"
41-
- "!include public_gov_action_proposal.yaml"
42-
- "!include public_committee_hash.yaml"
38+
- "!include public_drepHash.yaml"
39+
- "!include public_votingAnchor.yaml"
40+
- "!include public_votingProcedure.yaml"
41+
- "!include public_govActionProposal.yaml"
42+
- "!include public_committeeHash.yaml"
4343
- "!include public_pool_hash.yaml"
44-
- "!include public_off_chain_vote_data.yaml"
44+
- "!include public_offChainVoteData.yaml"
4545
- "!include public_committee.yaml"
46-
- "!include public_committee_de_registration.yaml"
47-
- "!include public_committee_member.yaml"
48-
- "!include public_committee_registration.yaml"
46+
- "!include public_committeeDeRegistration.yaml"
47+
- "!include public_committeeMember.yaml"
48+
- "!include public_committeeRegistration.yaml"
4949
- "!include public_drep_distr.yaml"
50-
- "!include public_off_chain_vote_author.yaml"
51-
- "!include public_off_chain_vote_drep_data.yaml"
52-
- "!include public_off_chain_vote_gov_action_data.yaml"
53-
- "!include public_off_chain_vote_reference.yaml"
50+
- "!include public_offChainVoteAuthor.yaml"
51+
- "!include public_offChainVoteDrepData.yaml"
52+
- "!include public_offChainVoteGovActionData.yaml"
53+
- "!include public_offChainVoteReference.yaml"
5454
- "!include public_stake_address.yaml"
55-
- "!include public_treasury_withdrawal.yaml"
55+
- "!include public_treasury_withdrawal.yaml"

‎packages/api-cardano-db-hasura/schema.graphql

+1,711-1,295
Large diffs are not rendered by default.

‎packages/api-cardano-db-hasura/src/executableSchema.ts

+220-38
Large diffs are not rendered by default.

‎scripts/dev_env.sh

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Source this with the CONTEXT and NETWORK env set, containing the full path and
2+
# supported network name.
3+
# e.g.
4+
# CONTEXT=$PWD NETWORK=mainnet . ./scripts/export_env.sh
5+
6+
export BIN_DIR=${CONTEXT}/bin
7+
export CONFIG_DIR=${CONTEXT}/config/network/${NETWORK}
8+
export SECRETS_DIR=${CONTEXT}/placeholder-secrets
9+
export STATE_DIR=${CONTEXT}/state/network/${NETWORK}
10+
11+
export API_PORT=3100
12+
export HASURA_PORT=8091
13+
export METADATA_SERVER_URI="http://localhost:8080"
14+
export OGMIOS_PORT=1337
15+
export PG_ADMIN_PORT=8444
16+
export POSTGRES_PORT=5433
17+
export TOKEN_REGISTRY_PORT=8080
18+
19+
20+
export ALLOW_INTROSPECTION=true
21+
export CARDANO_NODE_CONFIG_PATH=${CONFIG_DIR}/cardano-node/config.json
22+
export COMPOSE_DOCKER_CLI_BUILD=1
23+
export DOCKER_BUILDKIT=1
24+
export HASURA_CLI_PATH=/usr/local/bin/hasura
25+
export HASURA_CLI_EXT_PATH=${HASURA_CLI_PATH}
26+
export HASURA_URI=http://localhost:${HASURA_PORT}
27+
export OGMIOS_HOST=localhost
28+
export POSTGRES_DB=cexplorer
29+
export POSTGRES_PASSWORD=doNoUseThisSecret!
30+
export POSTGRES_USER=postgres
31+
export POSTGRES_HOST=localhost
32+
export TOKEN_REGISTRY_TAG=latest
33+
echo "exported dev env vars for ${NETWORK}"

0 commit comments

Comments
 (0)
Please sign in to comment.