From f3aad6bda2d67be8682df1b3dee176bf14040dcc Mon Sep 17 00:00:00 2001 From: Salief Date: Fri, 30 Jun 2023 12:27:08 -0400 Subject: [PATCH] small nit in prop return query --- .changeset/ninety-schools-doubt.md | 5 +++++ .../src/subgraph/queries/daoProposals.ts | 6 ++++++ .../builder-utils/src/subgraph/types/gql.ts | 6 +++--- .../src/subgraph/types/graphql.ts | 20 +++++++++++++++++++ 4 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 .changeset/ninety-schools-doubt.md diff --git a/.changeset/ninety-schools-doubt.md b/.changeset/ninety-schools-doubt.md new file mode 100644 index 0000000..1d628cd --- /dev/null +++ b/.changeset/ninety-schools-doubt.md @@ -0,0 +1,5 @@ +--- +'@public-assembly/builder-utils': patch +--- + +Fixes error where vote details were being returned by the wrong query. diff --git a/packages/builder-utils/src/subgraph/queries/daoProposals.ts b/packages/builder-utils/src/subgraph/queries/daoProposals.ts index 5b1b028..f4565a8 100644 --- a/packages/builder-utils/src/subgraph/queries/daoProposals.ts +++ b/packages/builder-utils/src/subgraph/queries/daoProposals.ts @@ -35,6 +35,12 @@ export const DAO_PROPOSALS_QUERY = graphql(` governorAddress tokenAddress } + votes { + reason + support + voter + weight + } } } } diff --git a/packages/builder-utils/src/subgraph/types/gql.ts b/packages/builder-utils/src/subgraph/types/gql.ts index c39ddaa..e9a5493 100644 --- a/packages/builder-utils/src/subgraph/types/gql.ts +++ b/packages/builder-utils/src/subgraph/types/gql.ts @@ -21,7 +21,7 @@ const documents = { types.DaoAddressesDocument, '\n query DaoDetails($id: ID!) {\n dao(id: $id) {\n name\n symbol\n description\n contractImage\n projectURI\n ownerCount\n totalSupply\n totalAuctionSales\n proposalCount\n }\n }\n': types.DaoDetailsDocument, - '\n query DaoProposals($id: ID!) {\n dao(id: $id) {\n proposals(orderDirection: desc, orderBy: timeCreated) {\n id\n abstainVotes\n againstVotes\n calldatas\n canceled\n description\n descriptionHash\n executableFrom\n executed\n expiresAt\n forVotes\n proposalId\n proposalNumber\n proposalThreshold\n proposer\n queued\n quorumVotes\n targets\n timeCreated\n title\n values\n vetoed\n voteCount\n voteEnd\n voteStart\n snapshotBlockNumber\n transactionHash\n dao {\n governorAddress\n tokenAddress\n }\n }\n }\n }\n': + '\n query DaoProposals($id: ID!) {\n dao(id: $id) {\n proposals(orderDirection: desc, orderBy: timeCreated) {\n id\n abstainVotes\n againstVotes\n calldatas\n canceled\n description\n descriptionHash\n executableFrom\n executed\n expiresAt\n forVotes\n proposalId\n proposalNumber\n proposalThreshold\n proposer\n queued\n quorumVotes\n targets\n timeCreated\n title\n values\n vetoed\n voteCount\n voteEnd\n voteStart\n snapshotBlockNumber\n transactionHash\n dao {\n governorAddress\n tokenAddress\n }\n votes {\n reason\n support\n voter\n weight\n }\n }\n }\n }\n': types.DaoProposalsDocument, '\n query HistoricalAuction($id: ID!, $tokenId: BigInt!) {\n dao(id: $id) {\n tokens(where: { tokenId: $tokenId }) {\n tokenId\n auction {\n startTime\n endTime\n extended\n winningBid {\n amount\n bidder\n }\n settled\n bids(orderBy: amount, orderDirection: desc) {\n bidder\n amount\n }\n }\n }\n }\n }\n': types.HistoricalAuctionDocument, @@ -75,8 +75,8 @@ export function graphql( * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ export function graphql( - source: '\n query DaoProposals($id: ID!) {\n dao(id: $id) {\n proposals(orderDirection: desc, orderBy: timeCreated) {\n id\n abstainVotes\n againstVotes\n calldatas\n canceled\n description\n descriptionHash\n executableFrom\n executed\n expiresAt\n forVotes\n proposalId\n proposalNumber\n proposalThreshold\n proposer\n queued\n quorumVotes\n targets\n timeCreated\n title\n values\n vetoed\n voteCount\n voteEnd\n voteStart\n snapshotBlockNumber\n transactionHash\n dao {\n governorAddress\n tokenAddress\n }\n }\n }\n }\n' -): typeof documents['\n query DaoProposals($id: ID!) {\n dao(id: $id) {\n proposals(orderDirection: desc, orderBy: timeCreated) {\n id\n abstainVotes\n againstVotes\n calldatas\n canceled\n description\n descriptionHash\n executableFrom\n executed\n expiresAt\n forVotes\n proposalId\n proposalNumber\n proposalThreshold\n proposer\n queued\n quorumVotes\n targets\n timeCreated\n title\n values\n vetoed\n voteCount\n voteEnd\n voteStart\n snapshotBlockNumber\n transactionHash\n dao {\n governorAddress\n tokenAddress\n }\n }\n }\n }\n'] + source: '\n query DaoProposals($id: ID!) {\n dao(id: $id) {\n proposals(orderDirection: desc, orderBy: timeCreated) {\n id\n abstainVotes\n againstVotes\n calldatas\n canceled\n description\n descriptionHash\n executableFrom\n executed\n expiresAt\n forVotes\n proposalId\n proposalNumber\n proposalThreshold\n proposer\n queued\n quorumVotes\n targets\n timeCreated\n title\n values\n vetoed\n voteCount\n voteEnd\n voteStart\n snapshotBlockNumber\n transactionHash\n dao {\n governorAddress\n tokenAddress\n }\n votes {\n reason\n support\n voter\n weight\n }\n }\n }\n }\n' +): typeof documents['\n query DaoProposals($id: ID!) {\n dao(id: $id) {\n proposals(orderDirection: desc, orderBy: timeCreated) {\n id\n abstainVotes\n againstVotes\n calldatas\n canceled\n description\n descriptionHash\n executableFrom\n executed\n expiresAt\n forVotes\n proposalId\n proposalNumber\n proposalThreshold\n proposer\n queued\n quorumVotes\n targets\n timeCreated\n title\n values\n vetoed\n voteCount\n voteEnd\n voteStart\n snapshotBlockNumber\n transactionHash\n dao {\n governorAddress\n tokenAddress\n }\n votes {\n reason\n support\n voter\n weight\n }\n }\n }\n }\n'] /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ diff --git a/packages/builder-utils/src/subgraph/types/graphql.ts b/packages/builder-utils/src/subgraph/types/graphql.ts index 283b5cc..856abc7 100644 --- a/packages/builder-utils/src/subgraph/types/graphql.ts +++ b/packages/builder-utils/src/subgraph/types/graphql.ts @@ -1958,6 +1958,13 @@ export type DaoProposalsQuery = { snapshotBlockNumber: any transactionHash: any dao: { __typename?: 'DAO'; governorAddress: any; tokenAddress: any } + votes: Array<{ + __typename?: 'ProposalVote' + reason?: string | null + support: ProposalVoteSupport + voter: any + weight: number + }> }> } | null } @@ -2442,6 +2449,19 @@ export const DaoProposalsDocument = { ], }, }, + { + kind: 'Field', + name: { kind: 'Name', value: 'votes' }, + selectionSet: { + kind: 'SelectionSet', + selections: [ + { kind: 'Field', name: { kind: 'Name', value: 'reason' } }, + { kind: 'Field', name: { kind: 'Name', value: 'support' } }, + { kind: 'Field', name: { kind: 'Name', value: 'voter' } }, + { kind: 'Field', name: { kind: 'Name', value: 'weight' } }, + ], + }, + }, ], }, },