balancer-subgraph icon indicating copy to clipboard operation
balancer-subgraph copied to clipboard

Transactions Schema Cleanup

Open calebsheridan opened this issue 4 years ago • 1 comments

Background

The Transaction schema can be cleaned up and make tighter guarantees for data.

Require event

Transaction.event is always set - update the schema to require this value.

https://thegraph.com/explorer/subgraph/balancer-labs/balancer

Query

{
  transactions(
    where:{
      event: null
    }
  ) {
    id
  }
}

Result

{
  "data": {
    "transactions": []
  }
}

Remove action

Transaction.action is never set. Remove from schema.

Query

{
  transactions(
    where:{
      action_not: null
    }
  ) {
    id
  }
}

Result

{
  "data": {
    "transactions": []
  }
}

Remove sender

Transaction.sender is never set. Remove from schema.

Query

{
  transactions(
    where:{
      sender_not: null
    }
  ) {
    id
  }
}

Result

{
  "data": {
    "transactions": []
  }
}

calebsheridan avatar Jul 01 '20 19:07 calebsheridan

I would add to this to make 1 tx entity per tx and tx_hash as ID. As it's currently done is super confusing for developers.

benesjan avatar Nov 22 '20 17:11 benesjan