-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest-gql.js
More file actions
35 lines (34 loc) · 697 Bytes
/
Copy pathtest-gql.js
File metadata and controls
35 lines (34 loc) · 697 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
const query = `
query GetClaims {
triples(
limit: 1
order_by: { created_at: desc }
) {
term_id
predicate_term {
atom {
label
}
}
term {
vaults {
curve_id
total_shares
position_count
}
}
counter_term {
vaults {
curve_id
total_shares
position_count
}
}
}
}
`;
fetch('https://mainnet.intuition.sh/v1/graphql', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ query })
}).then(r => r.json()).then(j => console.log(JSON.stringify(j, null, 2))).catch(console.error);