diff --git a/packages/api-cardano-db-hasura/schema.graphql b/packages/api-cardano-db-hasura/schema.graphql index f2525613..e3250cc1 100644 --- a/packages/api-cardano-db-hasura/schema.graphql +++ b/packages/api-cardano-db-hasura/schema.graphql @@ -101,6 +101,12 @@ type Query { offset: Int where: Delegation_bool_exp ): Delegation_aggregate + delegationVotes ( + limit: Int + order_by: [DelegationVote_order_by!] + offset: Int + where: DelegationVote_bool_exp + ): DelegationVote epochs ( limit: Int order_by: [Epoch_order_by!] @@ -624,6 +630,11 @@ input Delegation_order_by { transaction: Transaction_order_by } +input DelegationVote_order_by { + address: order_by + transaction: Transaction_order_by +} + input Delegation_bool_exp { _and: [Delegation_bool_exp] _not: Delegation_bool_exp @@ -635,6 +646,14 @@ input Delegation_bool_exp { transaction: Transaction_bool_exp } +input DelegationVote_bool_exp { + _and: [DelegationVote_bool_exp] + _not: DelegationVote_bool_exp + _or: [DelegationVote_bool_exp] + address: StakeAddress_comparison_exp + transaction: Transaction_bool_exp +} + type Delegation_aggregate { aggregate: Delegation_aggregate_fields } @@ -1916,3 +1935,26 @@ input VRFVerificationKey_comparison_exp { _neq: VRFVerificationKey _nin: [VRFVerificationKey] } + +type DelegationVote { + address: String + + """An object relationship""" + drep: drep_hash + drep_hash_id: Int! + id: Int! + + """An object relationship""" + redeemer: Redeemer + redeemerId: Int! + + """An object relationship""" + transaction: Transaction + tx_id: Int! +} + +type drep_hash { + has_script: Boolean! + id: Int! + view: String! +} \ No newline at end of file diff --git a/packages/api-cardano-db-hasura/src/executableSchema.ts b/packages/api-cardano-db-hasura/src/executableSchema.ts index 1b60c9c0..187faf63 100644 --- a/packages/api-cardano-db-hasura/src/executableSchema.ts +++ b/packages/api-cardano-db-hasura/src/executableSchema.ts @@ -329,6 +329,20 @@ export async function buildSchema ( selectionSet: null, extensions: getComplexityExtension('Query', 'delegations') }, + delegationVotes: { + resolve: (_root: any, args: any, context: any, info: any) => { + return delegateToSchema({ + args, + context, + fieldName: 'delegationVotes', + info, + operation: 'query', + schema: hasuraClient.schema + }) + }, + selectionSet: null, + extensions: getComplexityExtension('Query', 'delegationVotes') + }, delegations_aggregate: { resolve: (_root, args, context, info) => { return delegateToSchema({