-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathschema.graphql
More file actions
37 lines (32 loc) · 1.2 KB
/
schema.graphql
File metadata and controls
37 lines (32 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# About @index annotation
# To improve query performance, we strongly suggest adding indexes to any field that you plan to filter or sort by.
# Add the `@index` or `@index(unique: true) annotation after any non-key field.
# Learn more https://academy.subquery.network/build/graphql.html#supported-scalars-and-types
# About @derivedFrom annotation
# We always recommend enabling a reverse lookup on an entity to a related entity.
# Attach @derivedFrom to the field and point to its reverse lookup field of another entity.
# Learn more https://academy.subquery.network/build/graphql.html#reverse-lookups
type Transaction @entity {
id: ID! # Transaction hash
value: BigInt! @index
to: Account! # Foreign key field
from: Account! # Foreign key field
contractAddress: String! @index
}
type Account @entity {
id: ID! # Key
sentTransactions: [Transaction] @derivedFrom(field: "from")
receivedTransactions: [Transaction] @derivedFrom(field: "to")
}
type Approval @entity {
id: ID! # Transaction hash
value: BigInt! @index
owner: String! @index
spender: String! @index
contractAddress: String! @index
}
type Collator @entity {
id: ID! # Collator address
joinedDate: Date! @index
leaveDate: Date @index
}