aave / aave/protocol-subgraphs

Error Querying userReserve {id} Field in Protocol V3 Mainnet Subgraph

Open
#145 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
150
Forks
130
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
When querying historical supply data for the "Protocol V3 Mainnet" subgraph, an error occurs related to the userReserve {id} field on the supplies query. This prevents the query from successfully returning data.

To Reproduce
Query

{
  supplies(first: 1000, skip: 0, orderBy: timestamp, where: {timestamp_gte: 1700611200, timestamp_lt: 1700697600}) {
    id,
    txHash,
    action,
    timestamp,
    pool { id },
    user { id },
    caller { id },
    reserve { id, underlyingAsset, symbol, name },
    userReserve { id },
    referrer { id },
    amount,
    assetPriceUSD
  }
}

Response

{
  "data": null,
  "errors": [
    {
      "message": "Null value resolved for non-null field `userReserve`",
      "locations": [{"line": 22, "column": 3}]
    }
  ]
}

Expected behavior
The query should return a list of data without encountering errors, even if the userReserve {id} field is null or missing.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the supplied supplies query against the Protocol V3 Mainnet subgraph and inspect the userReserve field in the subgraph schema and mappings. Trace why userReserve resolves null for historical supplies, then verify that the query returns data when that relationship is absent or null.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, typescript
Domain
backend-api-design, blockchain
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.