当我使用 apollo 从端点获取数据时,如何增加 100 限制?

问题描述

当我尝试从 graphQL 端点获取数据时,它会将返回的数据量限制为 100。我该如何增加它?

客户:

export const dexCandlesGraph = chainId => {
  const uri = DEXCANDLES_SUBGRAPH[chainId ?? ChainId.AVALANCHE]
  return new ApolloClient({
    link: createHttpLink({
      uri: uri
    }),cache: new InMemoryCache()
  })
}

查询

export const dexCandlesQuery = gql`
  query dexCandlesQuery($token0: String!,$token1: String!,$period: Int!) {
    candles(orderBy: time,orderDirection: asc,where: { token0: $token0,token1: $token1,period: $period }) {
      time
      open
      low
      high
      close
    }
  }
`

进行查询

const results = await dexCandles.query({
  query: dexCandlesQuery,variables: { token0: sortedToken0,token1: sortedToken1,period }
})
// Number of maximum results returned is 100

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)