graphprotocol / graphprotocol/graph-node

Error when querying subgraphs: "panic processing query: called `Option::unwrap()` on a `None` value"

Open
#3,530 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Stale
Dominant language
Rust
Stars
3.2k
Forks
1.1k
Avg merge
4d 1h
Merged PRs (30d)
1

Description

The following query returns an error on most subgraphs:

Subgraphs that returns an error:
https://thegraph.com/hosted-service/subgraph/aave/protocol-v2
https://thegraph.com/hosted-service/subgraph/ensdomains/ens
https://thegraph.com/hosted-service/subgraph/uniswap/uniswap-v2
+++

Query:

{
  __schema{
    types{
      fields{
        name
      }
    }
  }
   _meta{
    deployment
  }
}

Error message

"message": "panic processing query: called `Option::unwrap()` on a `None` value"

Exception: The query works on this subgraph:
https://thegraph.com/hosted-service/subgraph/graphprotocol/compound-v2

If I split the query into two separate queries, they work for all tested subgraphs:

{
  __schema{
    types{
      fields{
        name
      }
    }
  }
}
{
   _meta{
    deployment
  }
}

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 reproducing the combined __schema and _meta query against the affected subgraphs, then compare it with the separately successful queries and the working Compound subgraph. Done means the combined query completes without the Option::unwrap() panic across the reported subgraphs.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, rust
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.