-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.graphql
58 lines (52 loc) · 1.43 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
enum NftType {
ERC721
ERC1155
}
type Nft @entity {
id: ID! # tokenAddress + tokenId
tokenAddress: String!
tokenId: BigInt!
owner: Account!
type: NftType!
amount: BigInt
roles: [Role!] @derivedFrom(field: "nft")
}
type Account @entity {
id: ID! # address
nfts: [Nft!] @derivedFrom(field: "owner")
rolesGranted: [RoleAssignment!] @derivedFrom(field: "grantor")
rolesReceived: [RoleAssignment!] @derivedFrom(field: "grantee")
roleApprovals: [RoleApproval!] @derivedFrom(field: "grantor")
}
type RoleAssignment @entity {
id: ID! # rolesRegistryAddress + grantorAddress + tokenAddress + tokenId + granteeAddress + roleHash
role: Role!
nft: Nft!
grantor: Account!
grantee: Account!
expirationDate: BigInt!
revocable: Boolean!
data: Bytes!
createdAt: BigInt!
updatedAt: BigInt!
}
type Role @entity {
id: ID! # rolesRegistryAddress + tokenAddress + tokenId + roleHash
rolesRegistry: RolesRegistry!
roleHash: Bytes!
nft: Nft!
roleAssignments: [RoleAssignment!] @derivedFrom(field: "role")
}
type RoleApproval @entity {
id: ID! # rolesRegistryAddress + grantorAddress + operatorAddress + tokenAddress
rolesRegistry: RolesRegistry!
grantor: Account!
operator: Account!
tokenAddress: String!
isApproved: Boolean!
}
type RolesRegistry @entity {
id: ID! # contractAddress
roles: [Role!] @derivedFrom(field: "rolesRegistry")
roleApprovals: [RoleApproval!] @derivedFrom(field: "rolesRegistry")
}