-
-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathArea.gql
More file actions
261 lines (222 loc) · 6 KB
/
Area.gql
File metadata and controls
261 lines (222 loc) · 6 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
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
type Query {
area(uuid: ID): Area
areas(filter: Filter, sort: Sort, limit: Int, offset: Int): [Area]
"""
Bulk download an area and its children starting from ancestors paths (inclusive).
To keep payload at a reasonable size ancestors must have at least 2 elements.
"""
bulkAreas(ancestors: [String!]!, limit: Int, offset: Int): [Area]
stats: Stats
cragsNear(
placeId: String
lnglat: Point
minDistance: Int = 0
maxDistance: Int = 48000
includeCrags: Boolean = false
): [CragsNear]
cragsWithin(filter: SearchWithinFilter): [Area]
countries: [Area]
}
"A climbing area, wall or crag"
type Area {
id: ID!
"We use UUID for identification of areas. The id field is used in internal database relations."
uuid: ID!
"The name that this area is commonly identified by"
area_name: String!
areaName: String!
"ShortCodes are short, globally uniqe codes that identify significant climbing areas"
shortCode: String
metadata: AreaMetadata!
"""
The climbs that appear within this area. If this area is a leaf node, then these climbs can be understood
as appearing physically on - rather than within - this area.
"""
climbs: [Climb]
"""
The areas that appear within this area. If this area is a leaf node,
you will not expect to see any child areas.
"""
children: [Area]
"UUIDs of this areas parents, traversing up the heirarchy to the root area."
ancestors: [String]!
"areaNames of this areas parents, traversing up the heirarchy to the root area."
pathTokens: [String]!
"statistics about this area"
aggregate: AggregateType
content: AreaContent
"pathTokens hashed into a single string"
pathHash: String
"""
Grade systems have minor variations between countries.
gradeContext is a short abbreviated string that identifies the
context in which the grade was assigned.
Area grade contexts will be inherited by its nearest child climbs.
"""
gradeContext: String!
"total climbs per km sq"
density: Float!
"The total number of climbs in this area"
totalClimbs: Int!
"Media associated with this area, or its child climbs"
media: [MediaWithTags]
"Paginated media for this area"
mediaPagination(input: EmbeddedAreaMediaInput): AreaMedia
"Metadata about creation & update of this area"
authorMetadata: AuthorMetadata!
"Organizations associated with this area or its parent areas"
organizations: [Organization]
"""
If you were to sum all approximate image sizes for this area, you get
a kind of picture of what the cost to cache all of the media in a given
area might be. You could use this to indicate a recommended compression
ratio or maybe know ahead of time if a given cache exercise would exceed
current storage capacity.
"""
imageByteSum: Int!
}
"""
This EmbeddedAreaMediaInput is different from the AreaMediaInput in Media.gql because we don't need to
include the areaUuid (which is required over in the paginated Media query). Here in the area query,
the areaUuid is already included in top level of the query
"""
input EmbeddedAreaMediaInput {
"Max number of objects return. Ignore when using with pagination query."
maxFiles: Int
"Number of objects per page (Default = 6)."
first: Int
"Returning page data after this cursor (exclusive). Return the first page if omitted."
after: ID
}
type AreaMetadata {
isDestination: Boolean!
"""
If this is true, this area has no children and is a leaf node.
This means that the area is a crag, boulder or wall that has
climbs as its direct decendents.
If both leaf and isBoulder are true:
- This area is a boulder.
- climbs[] may only contain boulder problems.
"""
leaf: Boolean!
"If this is true, this area is a bouldering area or an individual boulder."
isBoulder: Boolean
"centroid latitude of this areas bounding box"
lat: Float
"centroid longitude of this areas bounding box"
lng: Float
"NE and SW corners of the bounding box for this area"
bbox: [Float]
"Left-to-right sorting index. Undefined or -1 or unsorted area."
leftRightIndex: Int
"Mountainproject ID (if associated)"
mp_id: String!
area_id: ID!
areaId: ID!
"Array of the polygon vertices (convex hull) containing child areas."
polygon: [[Float]]
}
"""
Aggregations of data about this area, its children and its climbs.
"""
type AggregateType {
"""
Sums of climbs grouped by arbitrary grade
"""
byGrade: [CountByGroupType]
"""
Sums of climbs grouped by discipline
"""
byDiscipline: CountByDisciplineType
"""
Sums of climbs grouped by grade band (Rough adjective difficulty)
"""
byGradeBand: CountByGradeBand
}
type CountByDisciplineType {
trad: DisciplineStatsType
sport: DisciplineStatsType
bouldering: DisciplineStatsType
boulder: DisciplineStatsType @deprecated(reason: "Migrating to 'bouldering'")
deepwatersolo: DisciplineStatsType
alpine: DisciplineStatsType
snow: DisciplineStatsType
ice: DisciplineStatsType
mixed: DisciplineStatsType
aid: DisciplineStatsType
tr: DisciplineStatsType
}
type DisciplineStatsType {
total: Int!
bands: CountByGradeBand!
}
type CountByGroupType {
count: Int
label: String
}
type CountByGradeBand {
unknown: Int
beginner: Int
intermediate: Int
advanced: Int
expert: Int
}
type AreaContent {
description: String
areaLocation: String
}
input Point {
lat: Float
lng: Float
}
input SearchWithinFilter {
bbox: [Float]
zoom: Float
}
input Sort {
area_name: Int
density: Int
totalClimbs: Int
}
input Filter {
area_name: AreaFilter
leaf_status: LeafFilter
path_tokens: PathFilter
field_compare: [ComparisonFilter]
}
enum Field {
density
totalClimbs
}
enum CompareType {
lt
gt
eq
}
input ComparisonFilter {
field: Field
num: Float
comparison: CompareType
}
input PathFilter {
tokens: [String]!
exactMatch: Boolean
size: Int
}
input AreaFilter {
match: String!
exactMatch: Boolean
}
input LeafFilter {
isLeaf: Boolean!
}
type Stats {
totalClimbs: Int!
totalCrags: Int!
}
type CragsNear {
_id: ID!
placeId: String!
count: Int!
crags: [Area]
}