mirror of
https://github.com/cerc-io/watcher-ts
synced 2026-09-12 10:37:32 +00:00
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:
@@ -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!
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user