graphprotocol / graphprotocol/graph-node

Support for @derivedFrom field on an interface

Offen
#2,109 3 Kommentare 0 Reaktionen 2 zugewiesene Personen Auf GitHub ansehen

@dotansimha arbeitet bereits daran.

Seit 15.2.2022.

area/graphql enhancement
Vorherrschende Sprache
Rust
Sterne
3.2k
Forks
1.1k
Ø Merge
4 T. 1 Std.
Gemergte PRs (30 T.)
1

Beschreibung

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!]!")])]

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.