diff --git a/packages/data-layer/src/data-layer.ts b/packages/data-layer/src/data-layer.ts index dac929cc56..6e71d2af13 100644 --- a/packages/data-layer/src/data-layer.ts +++ b/packages/data-layer/src/data-layer.ts @@ -945,7 +945,6 @@ export class DataLayer { orderBy, filter, whitelistedPrograms, - query = getRoundsQuery, }: { chainIds: number[]; first: number; @@ -955,7 +954,7 @@ export class DataLayer { whitelistedPrograms?: string[]; query?: string | undefined; }): Promise<{ rounds: RoundGetRound[] }> { - return await request(this.gsIndexerEndpoint, query, { + return await request(this.gsIndexerEndpoint, getRoundsQuery, { orderBy: orderBy ?? "NATURAL", chainIds, first, diff --git a/packages/data-layer/src/queries.ts b/packages/data-layer/src/queries.ts index 21f4c6d45c..6e52fddf05 100644 --- a/packages/data-layer/src/queries.ts +++ b/packages/data-layer/src/queries.ts @@ -605,35 +605,6 @@ export const getBlockNumberQuery = gql` `; export const getRoundsQuery = gql` - query GetRounds( - $first: Int - $orderBy: [RoundsOrderBy!] - $filter: RoundFilter - ) { - rounds(first: $first, orderBy: $orderBy, filter: $filter) { - id - chainId - tags - roundMetadata - roundMetadataCid - applicationsStartTime - applicationsEndTime - donationsStartTime - donationsEndTime - matchAmountInUsd - matchAmount - matchTokenAddress - strategyId - strategyName - strategyAddress - applications(first: 1000, filter: { status: { equalTo: APPROVED } }) { - id - } - } - } -`; - -export const getRoundsQueryWithAllApplications = gql` query GetRounds( $first: Int $orderBy: [RoundsOrderBy!] diff --git a/packages/grant-explorer/src/features/api/rounds.ts b/packages/grant-explorer/src/features/api/rounds.ts index 3ec229deb6..27dc235086 100644 --- a/packages/grant-explorer/src/features/api/rounds.ts +++ b/packages/grant-explorer/src/features/api/rounds.ts @@ -6,8 +6,7 @@ import { RoundGetRound, RoundsQueryVariables, useDataLayer } from "data-layer"; export const useRounds = ( variables: RoundsQueryVariables, chainIds: number[], - onlywWhitelistedPrograms = false, - gqlQuery: string | undefined + onlywWhitelistedPrograms = false ): SWRResponse => { const dataLayer = useDataLayer(); @@ -27,7 +26,6 @@ export const useRounds = ( first: 500, chainIds, whitelistedPrograms, - query: gqlQuery, }), ]); diff --git a/packages/grant-explorer/src/features/discovery/ExploreRoundsPage.tsx b/packages/grant-explorer/src/features/discovery/ExploreRoundsPage.tsx index 412c750506..1428ad5e1f 100644 --- a/packages/grant-explorer/src/features/discovery/ExploreRoundsPage.tsx +++ b/packages/grant-explorer/src/features/discovery/ExploreRoundsPage.tsx @@ -11,7 +11,6 @@ import { getExplorerPageTitle } from "./utils/getExplorerPageTitle"; import { RoundsGrid } from "./RoundsGrid"; import { getEnabledChains } from "../../app/chainConfig"; import { useMemo } from "react"; -import { getRoundsQueryWithAllApplications } from "data-layer/src/queries"; const ExploreRoundsPage = () => { const [params] = useSearchParams(); @@ -20,8 +19,7 @@ const ExploreRoundsPage = () => { const rounds = useFilterRounds( filter, getEnabledChains(), - filter.status.includes("verified"), - getRoundsQueryWithAllApplications + filter.status.includes("verified") ); const publicRounds = useMemo( diff --git a/packages/grant-explorer/src/features/discovery/hooks/useFilterRounds.ts b/packages/grant-explorer/src/features/discovery/hooks/useFilterRounds.ts index 8f878374b9..5c52a0a441 100644 --- a/packages/grant-explorer/src/features/discovery/hooks/useFilterRounds.ts +++ b/packages/grant-explorer/src/features/discovery/hooks/useFilterRounds.ts @@ -75,8 +75,7 @@ export const ROUNDS_ENDING_SOON_FILTER: RoundSelectionParams & { export const useFilterRounds = ( where: RoundSelectionParams, chains: TChain[], - onlywWhitelistedPrograms?: boolean, - gqlQuery?: string | undefined + onlywWhitelistedPrograms?: boolean ): SWRResponse => { const chainIds = where.network === undefined || where.network.trim() === "" @@ -104,7 +103,7 @@ export const useFilterRounds = ( const orderBy = where.orderBy === undefined ? "CREATED_AT_BLOCK_DESC" : where.orderBy; const vars = { orderBy, filter }; - return useRounds(vars, chainIds, onlywWhitelistedPrograms, gqlQuery); + return useRounds(vars, chainIds, onlywWhitelistedPrograms); }; const createRoundWhereFilter = (