watcher-ts/packages/uni-info-watcher/test/queries.ts
Ashwin Phatak a9d411c6df
Smoke test for uni-info-watcher (#184)
* Smoke test for uni-info-watcher and refactor token deployment code.

* Test for Token entity after PoolCreated event.

* Test for Pool entity after PoolCreated event.

* Tests for entities after InitializeEvent.

Co-authored-by: prathamesh0 <prathamesh.musale0@gmail.com>
2021-08-04 18:57:44 +05:30

55 lines
1.1 KiB
TypeScript

import { gql } from 'graphql-request';
export const queryToken = gql`
query queryToken($id: ID!) {
token(id: $id) {
id
}
}`;
// Getting the first Factory entity.
export const queryFactory = gql`
{
factories(first: 1) {
id
}
}`;
// Getting the first Bundle entity.
export const queryBundle = gql`
{
bundles(first: 1) {
id
}
}`;
// Getting Pool by id.
export const queryPoolById = gql`
query queryPoolById($id: ID!) {
pool(id: $id) {
id,
sqrtPrice,
tick,
totalValueLockedUSD
}
}`;
// Getting Pool(s) filtered by tokens.
export const queryPoolsByTokens = gql`
query queryPoolsByTokens($tokens: [String!]) {
pools(where: { token0_in: $tokens, token1_in: $tokens }) {
id,
feeTier
}
}`;
// Getting PoolDayData(s) filtered by pool and ordered by date.
export const queryPoolDayData = gql`
query queryPoolDayData($first: Int, $orderBy: PoolDayData_orderBy, $orderDirection: OrderDirection, $pool: String) {
poolDayDatas(first: $first, orderBy: $orderBy, orderDirection: $orderDirection, where: { pool: $pool }) {
id,
date,
tvlUSD
}
}`;