forked from cosmicpoet/kanaria-land-sale-squid
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathschema.graphql
73 lines (68 loc) · 1.62 KB
/
schema.graphql
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
type Buyer @entity {
id: ID! # buyer
ownedPlots: [Plot!]! @derivedFrom(field: "owner")
sales: [Sale!]! @derivedFrom(field: "buyer")
plorOperationRecords: [PlotOperationRecord!]! @derivedFrom(field: "operator")
}
type Referrer @entity {
id: ID!
referredPlots: [Plot!]! @derivedFrom(field: "referrer")
referredSales: [Sale!]! @derivedFrom(field: "referrer")
}
type Sale @entity {
id: ID!
txHash: String!
plots: [Plot!]! @derivedFrom(field: "sale")
amount: BigInt!
buyer: Buyer!
referrer: Referrer!
boughtWithCredits: Boolean!
timestamp: BigInt!
block: Int!
}
type PlotOperationRecord @entity {
id: ID!
plot: Plot!
txHash: String!
block: Int!
timestamp: BigInt!
# type: LIST, CHANGE_PRICE, CANCEL, FULFILL, TRANSFER
# choose `String!` cause codegen doesn't support enum well
type: String!
operator: Buyer!
# when `type` is TRANSFER, `receiver` is set
receiver: Buyer
# when `type` is [LIST, CHANGE_PRICE, FULFILL], `price` is set
price: BigInt
}
type PlotData {
cyber: Int!
steampunk: Int!
wind: Int!
volcano: Int!
fire: Int!
water: Int!
necro: Int!
mecha: Int!
dragon: Int!
meadow: Int!
isShore: Int! # 0 = no, 1 = yes
isIsland: Int! # 0 = mainland, 1 = island
isMountainFoot: Int! # 0 = no, 1 = yes
rarity: Int!
entropy: Int!
}
type Plot @entity {
id: ID!
plotId: BigInt!
buyer: Buyer!
owner: Buyer!
referrer: Referrer!
sale: Sale!
data: PlotData!
# first be set by land sale
lastModifiedBlock: Int!
lastModifiedTime: BigInt!
# will set when this plot has bid or transfer
operationRecords: [PlotOperationRecord!]! @derivedFrom(field: "plot")
}