Skip to content

Commit

Permalink
Make runQuery accept a DocumentNode (#24)
Browse files Browse the repository at this point in the history
* export errors

* allow receiving a DocumentNode

* Revert "export errors"

This reverts commit e87cf04.
  • Loading branch information
ramirotw committed May 26, 2022
1 parent 47527e5 commit 6994903
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/api/cow-subgraph/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import log from 'loglevel'
import fetch from 'cross-fetch'
import { GraphQLClient, Variables } from 'graphql-request'
import { DocumentNode } from 'graphql'
import { CowError } from '../../utils/common'
import { Context } from '../../utils/context'
import { SupportedChainId as ChainId } from '../../constants/chains'
Expand Down Expand Up @@ -56,7 +57,7 @@ export class CowSubgraphApi {
return this.runQuery<LastHoursVolumeQuery>(LAST_HOURS_VOLUME_QUERY, { hours })
}

async runQuery<T>(query: string, variables?: Variables): Promise<T> {
async runQuery<T>(query: string | DocumentNode, variables?: Variables): Promise<T> {
try {
const chainId = await this.context.chainId
const client = this.clients[chainId]
Expand Down

0 comments on commit 6994903

Please sign in to comment.