graphprotocol / support

Community support for the Hosted Service of The Graph
https://thegraph.com/
10 stars 3 forks source link

Is it possible to query with a nested where syntax? #61

Closed max-block closed 3 years ago

max-block commented 4 years ago

https://thegraph.com/explorer/subgraph/uniswap/uniswap-v2 I'm trying to find all swaps, where swap.pair.token0.symbol="USDC".

I've tried two queries, buy they don't work.

{
  swaps(where:{pair:{token0:{symbol:"USDC"}}}){
    pair{
      token0{
        symbol
      }
    }
    timestamp
  }
}

This query generates an error: Invalid value provided for argument where: Object({\"pair\": Object({\"token0\": Object({\"symbol\": String(\"USDC\")})})})

{
  swaps{
    pair{
      token0(where:{symbol:"USDC"}){
        symbol
      }
    }
    timestamp
  }
}

This query runs, but doesn't filter by symbol.

leoyvens commented 3 years ago

This is a known limitation

heri16 commented 3 years ago

Any updates on this?

illiablkcha commented 2 years ago

there is not a way to solve the problem.

illiablkcha commented 2 years ago

it's a graphql bug.

schmidsi commented 2 years ago

@chenxiwang177 This is being worked on: https://github.com/graphprotocol/graph-node/pull/3184

yuranich commented 1 year ago

The above was merged year ago but syntax still doesn't work on uniswap v3 https://thegraph.com/hosted-service/subgraph/uniswap/uniswap-v3

Is it possible to do something about it?