graphprotocol / uniswap-subgraph

This is for uniswap-v1. If you are looking for the uniswap v2 subgraph, please go to https://github.com/uniswap/uniswap-v2-subgraph
104 stars 57 forks source link

How is the best way to fetch user's transactions? #10

Closed marcelomorgado closed 5 years ago

marcelomorgado commented 5 years ago

There are these queries that I was expected to return the same value but don't. Is it expected behavior? Why?

This query is returning a list of transactions

{       
  transactions (where: {user: "0x000000000a3c7c86345a35a0e97a4bb4370a8dd9"}) {
    tx
  }      
}

But that isn't:

{
  user (id: "0x000000000a3c7c86345a35a0e97a4bb4370a8dd9") {
    txs { 
      tx
    }
  }      
}

Thanks!

davekaj commented 5 years ago

Ah yes, this is a bug,

https://github.com/graphprotocol/uniswap-subgraph/blob/edcf0b2a45fffa52bdbdb9bab124d4d8484ccf19/schema.graphql#L68

That line derives the txs from userAddress, but that field is not on Transaction. I will fix this. Thanks for bringing this up!