Execute a custom query on the subgraph
import { downlinkClient } from './config' const data = await downlinkClient.customQuery({ ... })
any
DocumentNode
import { TokenFragment } from "@tx-kit/sdk/subgraph" const data = await downlinkClient.customQuery({ gql` query { channels(limit: 10) { id tokens(first: 10) { ...TokenFragment } } ${TOKEN_FRAGMENT} }`, ... })
GqlVariables
type GqlVariables = { [key: string]: string | number | boolean | undefined | string[] | object }
const data = await downlinkClient.customQuery( gql` query($timestamp: Int!) { channels( where: { tokens_: { blockTimestamp_gt: $timestamp } } limit: 10 ) { id tokens(first: 10) { ...TokenFragment } } ${TOKEN_FRAGMENT} }`, { timestamp: Math.floor(Date.now() / 1000) - 60 * 60 * 24 * 7 } // 1 week )