watcher-ts/packages/graph-node/test/subgraph/example1/schema.graphql
nikugogoi 238ad21189 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
2021-12-28 16:08:05 +05:30

30 lines
439 B
GraphQL

enum BlogKind {
short
long
}
type Blog @entity {
id: ID!
kind: BlogKind!
isActive: Boolean!
reviews: [BigInt!]!
author: Author!
categories: [Category!]!
}
type Author @entity {
id: ID!
blogCount: BigInt!
name: String! # string
rating: BigDecimal!
paramInt: Int! # uint8
paramBytes: Bytes!
blogs: [Blog!]! @derivedFrom(field: "author")
}
type Category @entity {
id: ID!
name: String!
count: BigInt!
}