Handle subgraph schema field with derivedFrom directive (#60)

* Handle subgraph schema field with derivedFrom directive

* Handle derivedFrom directive in eden-watcher

* Fix 1 to N relation error by removing limit from query

* Order by id for derivedFrom relations to match graph-node

* Refactor example subgraph schema entities

* Fix watcher queries to return correct relation field values

* Fix hierarchical query for getting two entities at same block
This commit is contained in:
2021-12-28 16:08:05 +05:30
committed by nabarun
parent b04f6f2fba
commit 238ad21189
26 changed files with 482 additions and 376 deletions
@@ -1,28 +1,29 @@
enum EnumType {
choice1
choice2
enum BlogKind {
short
long
}
type RelatedEntity @entity {
type Blog @entity {
id: ID!
paramBigInt: BigInt!
bigIntArray: [BigInt!]!
kind: BlogKind!
isActive: Boolean!
reviews: [BigInt!]!
author: Author!
categories: [Category!]!
}
type ExampleEntity @entity {
type Author @entity {
id: ID!
count: BigInt!
paramString: String! # string
blogCount: BigInt!
name: String! # string
rating: BigDecimal!
paramInt: Int! # uint8
paramBoolean: Boolean!
paramBytes: Bytes!
paramEnum: EnumType!
paramBigDecimal: BigDecimal!
related: RelatedEntity!
manyRelated: [ManyRelatedEntity!]!
blogs: [Blog!]! @derivedFrom(field: "author")
}
type ManyRelatedEntity @entity {
type Category @entity {
id: ID!
name: String!
count: BigInt!
}