-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.graphql
145 lines (121 loc) · 3.58 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
type ContractEvent @entity {
id: ID!
event: String
contract: Contract!
}
type Contract @entity {
# Contract Address
id: ID!
name: String
# Mainnet Subgraph
subgraphDeployment: [SubgraphDeployment!]! @derivedFrom(field: "contract")
contractEvent: [ContractEvent!]! @derivedFrom(field: "contract")
}
type Subgraph @entity {
id: ID!
active: Boolean!
owner: GraphAccount!
createdAt: Int!
updatedAt: Int!
displayName: String
description: String
image: String
codeRepository: String
website: String
versionCount: BigInt!
versions: [SubgraphVersion!]! @derivedFrom(field: "subgraph")
metadataHash: Bytes!
ipfsMetadataHash: String
currentVersion: SubgraphVersion
signalledTokens: BigInt!
unsignalledTokens: BigInt!
currentSignalledTokens: BigInt!
linkedEntity: Subgraph
entityVersion: Int!
currentVersionRelationEntity: CurrentSubgraphDeploymentRelation
initializing: Boolean!
}
type CurrentSubgraphDeploymentRelation @entity {
"Auxiliary entity used to batch update Subgraph entities when signalling on the deployment changes. ID replicates the deployment ID and adds a counter, to make it easy to reproduce."
id: ID!
subgraph: Subgraph!
deployment: SubgraphDeployment!
"Indicates whether this relation is active. This means that the deployment is still the current deployment for the named Subgraph"
active: Boolean!
}
type GraphAccount @entity {
id: ID!
subgraph: [Subgraph!]! @derivedFrom(field: "owner")
}
type SubgraphDeployment @entity {
id: ID!
ipfsHash: String!
versions: [SubgraphVersion!]! @derivedFrom(field: "subgraphDeployment")
subgraph: Subgraph!
createdAt: Int!
originalName: String
manifest: String
network: Network!
schema: String
schemaIpfsHash: String
contract: [Contract!]!
"CURRENT signalled tokens in the bonding curve"
signalledTokens: BigInt!
# Counters for currentSignalledTokens tracking on Subgraph
"Total amount of Subgraph entities that used this deployment at some point. subgraphCount >= activeSubgraphCount + deprecatedSubgraphCount"
subgraphCount: Int!
"Amount of active Subgraph entities that are currently using this deployment. Deprecated subgraph entities are not counted"
activeSubgraphCount: Int!
"Amount of Subgraph entities that were currently using this deployment when they got deprecated"
deprecatedSubgraphCount: Int!
}
type Network @entity {
id: ID!
deployments: [SubgraphDeployment!]! @derivedFrom(field: "network")
}
type SubgraphVersion @entity {
id: ID!
subgraph: Subgraph!
subgraphDeployment: SubgraphDeployment!
version: Int!
createdAt: Int!
metadataHash: Bytes
description: String
label: String
linkedEntity: Subgraph
entityVersion: Int!
}
"""
Full test search
"""
type _Schema_
@fulltext(
name: "contractEventSearch"
language: en
algorithm: rank
include: [{ entity: "ContractEvent", fields: [{ name: "event" }] }]
)
@fulltext(
name: "contractSearch"
language: en
algorithm: rank
include: [{ entity: "Contract", fields: [{ name: "id" }] }]
)
@fulltext(
name: "subgraphSearch"
language: en
algorithm: rank
include: [{ entity: "Subgraph", fields: [{ name: "displayName" }, { name: "description" }, { name: "codeRepository"}, { name: "website" }] }]
)
@fulltext(
name: "graphAccountSearch"
language: en
algorithm: rank
include: [{ entity: "GraphAccount", fields: [{ name: "id" }] }]
)
@fulltext(
name: "subgraphDeploymentSearch"
language: en
algorithm: rank
include: [{ entity: "SubgraphDeployment", fields: [{ name: "originalName" }] }]
)