Skip to content

Commit

Permalink
adjusts sort order for bid queries
Browse files Browse the repository at this point in the history
  • Loading branch information
salieflewis committed Jun 27, 2023
1 parent 7e35c8a commit f716ef4
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/heavy-queens-travel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@public-assembly/builder-utils': patch
---

Adds sort order to bid queries. Adds bid query directly to current auction query.
4 changes: 4 additions & 0 deletions packages/builder-utils/src/subgraph/queries/currentAuction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ export const CURRENT_AUCTION_QUERY = graphql(`
token {
tokenId
}
bids(orderBy: amount, orderDirection: desc) {
bidder
amount
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const HISTORICAL_AUCTION_QUERY = graphql(`
bidder
}
settled
bids {
bids(orderBy: amount, orderDirection: desc) {
bidder
amount
}
Expand Down
12 changes: 6 additions & 6 deletions packages/builder-utils/src/subgraph/types/gql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/
const documents = {
'\n query AuctionConfig($id: ID!) {\n dao(id: $id) {\n auctionConfig {\n minimumBidIncrement\n reservePrice\n timeBuffer\n duration\n }\n }\n }\n':
types.AuctionConfigDocument,
'\n query CurrentAuction($id: ID!) {\n dao(id: $id) {\n currentAuction {\n token {\n tokenId\n }\n startTime\n endTime\n extended\n settled\n winningBid {\n amount\n bidder\n }\n highestBid {\n amount\n bidder\n }\n token {\n tokenId\n }\n }\n }\n }\n':
'\n query CurrentAuction($id: ID!) {\n dao(id: $id) {\n currentAuction {\n token {\n tokenId\n }\n startTime\n endTime\n extended\n settled\n winningBid {\n amount\n bidder\n }\n highestBid {\n amount\n bidder\n }\n token {\n tokenId\n }\n bids(orderBy: amount, orderDirection: desc) {\n bidder\n amount\n }\n }\n }\n }\n':
types.CurrentAuctionDocument,
'\n query DaoAddresses($id: ID!) {\n dao(id: $id) {\n treasuryAddress\n auctionAddress\n governorAddress\n metadataAddress\n }\n }\n':
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 }\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 {\n bidder\n amount\n }\n }\n }\n }\n }\n':
'\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,
'\n query HistoricalToken($id: ID!, $tokenId: BigInt!) {\n dao(id: $id) {\n tokens(where: { tokenId: $tokenId }) {\n tokenId\n name\n owner\n mintedAt\n image\n }\n }\n }\n':
types.HistoricalTokenDocument,
Expand Down Expand Up @@ -57,8 +57,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 CurrentAuction($id: ID!) {\n dao(id: $id) {\n currentAuction {\n token {\n tokenId\n }\n startTime\n endTime\n extended\n settled\n winningBid {\n amount\n bidder\n }\n highestBid {\n amount\n bidder\n }\n token {\n tokenId\n }\n }\n }\n }\n'
): typeof documents['\n query CurrentAuction($id: ID!) {\n dao(id: $id) {\n currentAuction {\n token {\n tokenId\n }\n startTime\n endTime\n extended\n settled\n winningBid {\n amount\n bidder\n }\n highestBid {\n amount\n bidder\n }\n token {\n tokenId\n }\n }\n }\n }\n']
source: '\n query CurrentAuction($id: ID!) {\n dao(id: $id) {\n currentAuction {\n token {\n tokenId\n }\n startTime\n endTime\n extended\n settled\n winningBid {\n amount\n bidder\n }\n highestBid {\n amount\n bidder\n }\n token {\n tokenId\n }\n bids(orderBy: amount, orderDirection: desc) {\n bidder\n amount\n }\n }\n }\n }\n'
): typeof documents['\n query CurrentAuction($id: ID!) {\n dao(id: $id) {\n currentAuction {\n token {\n tokenId\n }\n startTime\n endTime\n extended\n settled\n winningBid {\n amount\n bidder\n }\n highestBid {\n amount\n bidder\n }\n token {\n tokenId\n }\n bids(orderBy: amount, orderDirection: desc) {\n bidder\n amount\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 All @@ -81,8 +81,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 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 {\n bidder\n amount\n }\n }\n }\n }\n }\n'
): typeof documents['\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 {\n bidder\n amount\n }\n }\n }\n }\n }\n']
source: '\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'
): typeof documents['\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']
/**
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
*/
Expand Down
36 changes: 36 additions & 0 deletions packages/builder-utils/src/subgraph/types/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1880,6 +1880,7 @@ export type CurrentAuctionQuery = {
token: { __typename?: 'Token'; tokenId: any }
winningBid?: { __typename?: 'AuctionBid'; amount: any; bidder: any } | null
highestBid?: { __typename?: 'AuctionBid'; amount: any; bidder: any } | null
bids?: Array<{ __typename?: 'AuctionBid'; bidder: any; amount: any }> | null
} | null
} | null
}
Expand Down Expand Up @@ -2169,6 +2170,29 @@ export const CurrentAuctionDocument = {
],
},
},
{
kind: 'Field',
name: { kind: 'Name', value: 'bids' },
arguments: [
{
kind: 'Argument',
name: { kind: 'Name', value: 'orderBy' },
value: { kind: 'EnumValue', value: 'amount' },
},
{
kind: 'Argument',
name: { kind: 'Name', value: 'orderDirection' },
value: { kind: 'EnumValue', value: 'desc' },
},
],
selectionSet: {
kind: 'SelectionSet',
selections: [
{ kind: 'Field', name: { kind: 'Name', value: 'bidder' } },
{ kind: 'Field', name: { kind: 'Name', value: 'amount' } },
],
},
},
],
},
},
Expand Down Expand Up @@ -2433,6 +2457,18 @@ export const HistoricalAuctionDocument = {
{
kind: 'Field',
name: { kind: 'Name', value: 'bids' },
arguments: [
{
kind: 'Argument',
name: { kind: 'Name', value: 'orderBy' },
value: { kind: 'EnumValue', value: 'amount' },
},
{
kind: 'Argument',
name: { kind: 'Name', value: 'orderDirection' },
value: { kind: 'EnumValue', value: 'desc' },
},
],
selectionSet: {
kind: 'SelectionSet',
selections: [
Expand Down

0 comments on commit f716ef4

Please sign in to comment.