From 39b1766152a80d8885a0e9dc5ae385d2cf5cf063 Mon Sep 17 00:00:00 2001 From: Agustincito Date: Tue, 11 Nov 2025 08:54:42 -0300 Subject: [PATCH 1/2] 9 Subgraph: Fix query --- examples/9-subgraph-query/src/task.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/examples/9-subgraph-query/src/task.ts b/examples/9-subgraph-query/src/task.ts index f95606c..c8f8c43 100644 --- a/examples/9-subgraph-query/src/task.ts +++ b/examples/9-subgraph-query/src/task.ts @@ -51,13 +51,7 @@ function getTokenPrice(chainId: i32, subgraphId: string, tokenIn: Address, token token1 = tokenIn } - const query = ` - { - pools(where: { token0: "${token0.toString()}", token1: "${token1.toString()}" }) { - token0Price # token0 per token1 - token1Price # token1 per token0 - } - }` + const query = `{pools(where: { token0: "${token0.toString()}", token1: "${token1.toString()}" }) {token0Price token1Price}}` const response = environment.subgraphQuery(chainId, subgraphId, query, null) const data = JSON.parse(response.data) From 1118e405b500aadf4b79588403b945f8435ad39f Mon Sep 17 00:00:00 2001 From: Agustincito Date: Tue, 11 Nov 2025 09:01:43 -0300 Subject: [PATCH 2/2] Fix tests --- examples/9-subgraph-query/tests/task.spec.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/examples/9-subgraph-query/tests/task.spec.ts b/examples/9-subgraph-query/tests/task.spec.ts index 030d34b..08bc9bd 100644 --- a/examples/9-subgraph-query/tests/task.spec.ts +++ b/examples/9-subgraph-query/tests/task.spec.ts @@ -23,13 +23,7 @@ describe('Task', () => { request: { chainId: inputs.chainId, subgraphId: inputs.subgraphId, - query: ` - { - pools(where: { token0: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", token1: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2" }) { - token0Price # token0 per token1 - token1Price # token1 per token0 - } - }`, + query: `{pools(where: { token0: "${inputs.tokenIn}", token1: "${inputs.tokenOut}" }) {token0Price token1Price}}`, }, response: { blockNumber: 1,