Skip to content

Local subgraph returning null #2633

Description

@EzraWeller

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
System info:

  • OSX 11.3
  • node 14.7.0

Schema includes this entity:

type Content @entity {
  id: ID!
  nftAddress: Bytes!
  nftId: BigInt!
  purchasableLicenses: [PurchasableLicense!]! @derivedFrom(field: "content")
  revShareLicenses: [RevShareLicense!]! @derivedFrom(field: "content")
}

Process to reproduce (at least on my machine):

  1. Deploy a local hardhat network node
  2. Deploy contracts to hardhat node
  3. docker-compose up local graph node
  4. Deploy subgraph to local graph node -- no errors
  5. Run tests that include queries for content(id: $id) {} and contents {}
  6. all content(id: $id) {} queries return null:
querying content id:  0x9fe46736679d2d9a65f0992f2272de9f3c7fa6e0-0x0b
{ data: { content: null } }

while contents {} return as expected:

{
  data: {
    contents: [
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object], [Object],
      [Object], [Object]
    ]
  }
}
last content id 0x9fe46736679d2d9a65f0992f2272de9f3c7fa6e0-0xb

I have found that after some indeterminate amount of time running, this problem goes away and the queries return as expected, without any changes to the code. I haven't been able to reproduce that, though.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
Sorry, not sure how to share more of a demo than the above without spending the next 30 minutes on it. Let me know if any logs would be helpful.

What is the expected behavior?
After successfully deploying the local subgraph, I expect queries of the form content(id: $id) to return a content entity if queries of the form contents {} return a content entity with that ID.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions