Skip to content

Commit

Permalink
Subgraph queries
Browse files Browse the repository at this point in the history
  • Loading branch information
nigeon committed Nov 3, 2023
1 parent d23e164 commit cb294a1
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 115 deletions.
2 changes: 1 addition & 1 deletion packages/js-client/src/internal/graphql-queries/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// add your grapql queries here and export them with this file
export * from './settings';
export * from './proposal';
export * from './token';
139 changes: 51 additions & 88 deletions packages/js-client/src/internal/graphql-queries/proposal.ts
Original file line number Diff line number Diff line change
@@ -1,77 +1,54 @@
import { gql } from 'graphql-request';

export const QueryTokenVotingProposal = gql`
query TokenVotingProposal($proposalId: ID!) {
export const QueryPluginProposal = gql`
query PluginProposal($proposalId: ID!) {
tokenVotingProposal(id: $proposalId) {
id
dao {
id
subdomain
}
creator
metadata
createdAt
creationBlockNumber
executionDate
executionBlockNumber
actions {
to
id
value
data
}
yes
no
abstain
votingMode
supportThreshold
allowFailureMap
failureMap
pluginProposalId
vochainProposalId
creator
startDate
endDate
createdAt
voteEndDate
tallyEndDate
creationBlockNumber
snapshotBlock
executed
earlyExecutable
potentiallyExecutable
executionDate
executionBlockNumber
executionTxHash
voters {
voter {
address
}
voteReplaced
voteOption
votingPower
approvers {
id
}
plugin {
token {
id
name
symbol
__typename
... on ERC20Contract {
decimals
}
... on ERC20WrapperContract {
decimals
underlyingToken {
id
name
symbol
decimals
}
}
}
tally {
id
values
}
totalVotingPower
minVotingPower
tallyApproved
}
}
`;
export const QueryTokenVotingProposals = gql`
query TokenVotingProposals(
$where: TokenVotingProposal_filter!

export const QueryPluginProposals = gql`
query QueryPluginProposals(
$where: PluginProposal_filter!
$limit: Int!
$skip: Int!
$direction: OrderDirection!
$sortBy: TokenVotingProposal_orderBy!
$sortBy: TPluginProposal_orderBy!
) {
tokenVotingProposals(
pluginProposals(
where: $where
first: $limit
skip: $skip
Expand All @@ -81,50 +58,36 @@ export const QueryTokenVotingProposals = gql`
id
dao {
id
subdomain
}
creator
metadata
yes
no
abstain
actions {
id
value
data
}
allowFailureMap
failureMap
pluginProposalId
vochainProposalId
creator
startDate
endDate
createdAt
voteEndDate
tallyEndDate
creationBlockNumber
snapshotBlock
executed
earlyExecutable
potentiallyExecutable
votingMode
supportThreshold
minVotingPower
totalVotingPower
voters {
voter {
address
}
voteReplaced
voteOption
votingPower
executionDate
executionBlockNumber
executionTxHash
approvers {
id
}
plugin {
token {
id
name
symbol
__typename
... on ERC20Contract {
decimals
}
... on ERC20WrapperContract {
decimals
underlyingToken {
id
name
symbol
decimals
}
}
}
tally {
id
values
}
tallyApproved
}
}
`;
19 changes: 19 additions & 0 deletions packages/js-client/src/internal/graphql-queries/settings.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { gql } from 'graphql-request';

export const QueryPluginSettings = gql`
query PluginSettings($address: ID!, $block: Block_height) {
plugin(id: $address, block: $block) {
id
onlyExecutionMultisigProposalCreation
minTallyApprovals
minParticipation
supportThreshold
minVoteDuration
minTallyDuration
daoTokenAddress
censusStrategyURI
minProposerVotingPower
executionMultisigMembers
}
}
`;
26 changes: 0 additions & 26 deletions packages/js-client/src/internal/graphql-queries/token.ts

This file was deleted.

0 comments on commit cb294a1

Please sign in to comment.