-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
35 lines (32 loc) · 701 Bytes
/
index.js
File metadata and controls
35 lines (32 loc) · 701 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { execute } from './.graphclient/index.mjs'
async function main() {
const response = await execute(
/* GraphQL */ `
{
# this one is coming from compound-v2
markets(first: 7) {
borrowRate
cash
collateralFactor
}
# this one is coming from uniswap-v2
pair(id: "0x00004ee988665cdda9a1080d5792cecd16dc1220") {
id
token0 {
id
symbol
name
}
token1 {
id
symbol
name
}
}
}
`,
{},
)
console.log(response)
}
main().catch((e) => console.error(`Failed to run example:`, e))