diff --git a/packages/js-client/src/internal/graphql-queries/index.ts b/packages/js-client/src/internal/graphql-queries/index.ts index 075975eb..2424681f 100644 --- a/packages/js-client/src/internal/graphql-queries/index.ts +++ b/packages/js-client/src/internal/graphql-queries/index.ts @@ -1,3 +1,3 @@ // add your grapql queries here and export them with this file +export * from './settings'; export * from './proposal'; -export * from './token'; diff --git a/packages/js-client/src/internal/graphql-queries/proposal.ts b/packages/js-client/src/internal/graphql-queries/proposal.ts index 3e2690df..4ef338d4 100644 --- a/packages/js-client/src/internal/graphql-queries/proposal.ts +++ b/packages/js-client/src/internal/graphql-queries/proposal.ts @@ -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 @@ -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 } } `; diff --git a/packages/js-client/src/internal/graphql-queries/settings.ts b/packages/js-client/src/internal/graphql-queries/settings.ts new file mode 100644 index 00000000..443ec710 --- /dev/null +++ b/packages/js-client/src/internal/graphql-queries/settings.ts @@ -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 + } + } +`; diff --git a/packages/js-client/src/internal/graphql-queries/token.ts b/packages/js-client/src/internal/graphql-queries/token.ts deleted file mode 100644 index 90b1c5ae..00000000 --- a/packages/js-client/src/internal/graphql-queries/token.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { gql } from 'graphql-request'; - -export const QueryGalsessVotingPluginToken = gql` - query GalsessVotingPluginToken($address: ID!) { - galsessVotingPluginToken(id: $address) { - token { - id - name - symbol - __typename - ... on ERC20WrapperContract { - decimals - underlyingToken { - id - name - symbol - decimals - } - } - ... on ERC20Contract { - decimals - } - } - } - } -`;