diff --git a/modules/pool/lib/pool-gql-loader.service.ts b/modules/pool/lib/pool-gql-loader.service.ts index 39504612f..dc8dba955 100644 --- a/modules/pool/lib/pool-gql-loader.service.ts +++ b/modules/pool/lib/pool-gql-loader.service.ts @@ -131,9 +131,9 @@ export class PoolGqlLoaderService { return pools.map((pool) => this.mapPoolToGqlPool(pool)) as GqlPoolLinear[]; } - public async getGyroPools(): Promise { + public async getGyroPools(chains: Chain[]): Promise { const pools = await prisma.prismaPool.findMany({ - where: { type: { in: ['GYRO', 'GYRO3', 'GYROE'] }, chain: networkContext.chain }, + where: { type: { in: ['GYRO', 'GYRO3', 'GYROE'] }, chain: { in: chains } }, orderBy: { dynamicData: { totalLiquidity: 'desc' } }, include: prismaPoolWithExpandedNesting.include, }); diff --git a/modules/pool/pool.resolvers.ts b/modules/pool/pool.resolvers.ts index bb8275e65..7bf0519f3 100644 --- a/modules/pool/pool.resolvers.ts +++ b/modules/pool/pool.resolvers.ts @@ -91,16 +91,21 @@ const balancerResolvers: Resolvers = { } return poolService.getGqlLinearPools(chains); }, - poolGetGyroPools: async () => { - return poolService.getGqlGyroPools(); + poolGetGyroPools: async (parent, { chains }, context) => { + const currentChain = headerChain(); + if (!chains && currentChain) { + chains = [currentChain]; + } else if (!chains) { + throw new Error('poolGetGyroPools error: Provide "chains" param'); + } + return poolService.getGqlGyroPools(chains); }, - poolGetFxPools: async (parent, { chains }) => { const currentChain = headerChain(); if (!chains && currentChain) { chains = [currentChain]; } else if (!chains) { - throw new Error('poolGetLinearPools error: Provide "chains" param'); + throw new Error('poolGetFxPools error: Provide "chains" param'); } return poolService.getGqlFxPools(chains); }, diff --git a/modules/pool/pool.service.ts b/modules/pool/pool.service.ts index ef91a0fcf..93ae434c6 100644 --- a/modules/pool/pool.service.ts +++ b/modules/pool/pool.service.ts @@ -83,8 +83,8 @@ export class PoolService { return this.poolGqlLoaderService.getLinearPools(chains); } - public async getGqlGyroPools(): Promise { - return this.poolGqlLoaderService.getGyroPools(); + public async getGqlGyroPools(chains: Chain[]): Promise { + return this.poolGqlLoaderService.getGyroPools(chains); } public async getGqlFxPools(chains: Chain[]): Promise {