Skip to content

Commit

Permalink
small nit in prop return query
Browse files Browse the repository at this point in the history
  • Loading branch information
salieflewis committed Jun 30, 2023
1 parent d1b8825 commit f3aad6b
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/ninety-schools-doubt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@public-assembly/builder-utils': patch
---

Fixes error where vote details were being returned by the wrong query.
6 changes: 6 additions & 0 deletions packages/builder-utils/src/subgraph/queries/daoProposals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ export const DAO_PROPOSALS_QUERY = graphql(`
governorAddress
tokenAddress
}
votes {
reason
support
voter
weight
}
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions packages/builder-utils/src/subgraph/types/gql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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.
*/
Expand Down
20 changes: 20 additions & 0 deletions packages/builder-utils/src/subgraph/types/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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' } },
],
},
},
],
},
},
Expand Down

0 comments on commit f3aad6b

Please sign in to comment.