Skip to content

Commit

Permalink
fix: added delegation votes to schema
Browse files Browse the repository at this point in the history
  • Loading branch information
Kammerlo committed Nov 25, 2024
1 parent 854987a commit dc96b88
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
42 changes: 42 additions & 0 deletions packages/api-cardano-db-hasura/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -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!]
Expand Down Expand Up @@ -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
Expand All @@ -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
}
Expand Down Expand Up @@ -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!
}
14 changes: 14 additions & 0 deletions packages/api-cardano-db-hasura/src/executableSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit dc96b88

Please sign in to comment.