graphprotocol / graphprotocol/graph-node

Support for @derivedFrom field on an interface

Open
#2,109 3 comments 0 reactions 2 assignees View on GitHub

@dotansimha is already working on this.

Since Feb 15, 2022.

area/graphql enhancement
Dominant language
Rust
Stars
3.2k
Forks
1.1k
Avg merge
4d 1h
Merged PRs (30d)
1

Description

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

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
The following schema throws an error:

interface Owner {
  id: ID!
}

type Pool implements Owner @entity {
  id: ID! # Contract address
  loanPositions: [LoanPosition!] @derivedFrom(field: "owner")
}

type User implements Owner @entity {
  id: ID! # ethereum address
  loans: [Loan!] @derivedFrom(field: "borrower") # Loans, created by the user
  loanPositions: [LoanPosition!] @derivedFrom(field: "owner")
}

type LoanPosition @entity {
  id: ID!
  owner: Owner!
  loan: Loan!
}

Error:
✖ Failed to deploy to Graph node http://localhost:8020/: subgraph validation error: [SchemaValidationError([InvalidDerivedFrom("Pool", "loanPositions", "field owneron typeLoanPosition must have one of the following types: Pool, Pool!, [Pool!], [Pool!]!")])]

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.