@@ -14,29 +14,44 @@ import ClassTypeEnum from "./class_type_enum";
14
14
15
15
const Author = new GraphQLObjectType ( {
16
16
name : "Author" ,
17
+ description : "An author of a map" ,
17
18
18
19
fields : ( ) => ( {
19
- id : { type : new GraphQLNonNull ( GraphQLInt ) } ,
20
- name : { type : new GraphQLNonNull ( GraphQLString ) } ,
20
+ id : {
21
+ type : new GraphQLNonNull ( GraphQLInt ) ,
22
+ description : "The ID of the author" ,
23
+ } ,
24
+ name : {
25
+ type : new GraphQLNonNull ( GraphQLString ) ,
26
+ description : "The name of the author" ,
27
+ } ,
21
28
mapCount : {
22
29
type : new GraphQLNonNull ( GraphQLInt ) ,
30
+ description : "The number of maps this author has created" ,
23
31
resolve : ( author ) => author . map_count ,
24
32
} ,
25
- player : { type : PlayerType } ,
33
+ player : {
34
+ type : PlayerType ,
35
+ description :
36
+ "The author's Player, if the author is a registered Tempus player" ,
37
+ } ,
26
38
} ) ,
27
39
} ) ;
28
40
29
41
const MapVideos = new GraphQLObjectType ( {
30
42
name : "MapVideos" ,
43
+ description : "The videos with playthroughs of a map" ,
31
44
32
45
fields : ( ) => ( {
33
46
soldier : {
34
47
type : GraphQLString ,
48
+ description : "The URL for the video of a soldier playthrough of a map" ,
35
49
resolve : ( videos ) =>
36
50
videos . soldier && `https://youtube.com/watch?v=${ videos . soldier } ` ,
37
51
} ,
38
52
demoman : {
39
53
type : GraphQLString ,
54
+ description : "The URL for the video of a demoman playthrough of a map" ,
40
55
resolve : ( videos ) =>
41
56
videos . demoman && `https://youtube.com/watch?v=${ videos . demoman } ` ,
42
57
} ,
@@ -45,37 +60,48 @@ const MapVideos = new GraphQLObjectType({
45
60
46
61
const Zones = new GraphQLObjectType ( {
47
62
name : "Zones" ,
63
+ description : "The zones for a map" ,
48
64
49
65
fields : ( ) => ( {
50
66
bonus : {
51
67
type : new GraphQLNonNull ( new GraphQLList ( new GraphQLNonNull ( ZoneType ) ) ) ,
68
+ description : "The bonus zones for a map" ,
52
69
} ,
53
70
bonusEnd : {
54
71
type : new GraphQLNonNull ( new GraphQLList ( new GraphQLNonNull ( ZoneType ) ) ) ,
72
+ description : "The bonus end zones for a map" ,
55
73
} ,
56
74
checkpoint : {
57
75
type : new GraphQLNonNull ( new GraphQLList ( new GraphQLNonNull ( ZoneType ) ) ) ,
76
+ description : "The checkpoint zones for a map" ,
58
77
} ,
59
78
course : {
60
79
type : new GraphQLNonNull ( new GraphQLList ( new GraphQLNonNull ( ZoneType ) ) ) ,
80
+ description : "The course zones for a map" ,
61
81
} ,
62
82
courseEnd : {
63
83
type : new GraphQLNonNull ( new GraphQLList ( new GraphQLNonNull ( ZoneType ) ) ) ,
84
+ description : "The course end zones for a map" ,
64
85
} ,
65
86
linear : {
66
87
type : new GraphQLNonNull ( new GraphQLList ( new GraphQLNonNull ( ZoneType ) ) ) ,
88
+ description : "The linear zones for a map" ,
67
89
} ,
68
90
map : {
69
91
type : new GraphQLNonNull ( new GraphQLList ( new GraphQLNonNull ( ZoneType ) ) ) ,
92
+ description : "The map zones for a map" ,
70
93
} ,
71
94
mapEnd : {
72
95
type : new GraphQLNonNull ( new GraphQLList ( new GraphQLNonNull ( ZoneType ) ) ) ,
96
+ description : "The end zones for a map" ,
73
97
} ,
74
98
misc : {
75
99
type : new GraphQLNonNull ( new GraphQLList ( new GraphQLNonNull ( ZoneType ) ) ) ,
100
+ description : "The miscellaneous zones for a map" ,
76
101
} ,
77
102
trick : {
78
103
type : new GraphQLNonNull ( new GraphQLList ( new GraphQLNonNull ( ZoneType ) ) ) ,
104
+ description : "The trick zones for a map" ,
79
105
} ,
80
106
} ) ,
81
107
} ) ;
@@ -85,16 +111,34 @@ export default new GraphQLObjectType({
85
111
description : "A jump map" ,
86
112
87
113
fields : ( ) => ( {
88
- id : { type : new GraphQLNonNull ( GraphQLString ) } ,
89
- name : { type : new GraphQLNonNull ( GraphQLString ) } ,
114
+ id : {
115
+ type : new GraphQLNonNull ( GraphQLString ) ,
116
+ description : "The ID of the map" ,
117
+ } ,
118
+ name : {
119
+ type : new GraphQLNonNull ( GraphQLString ) ,
120
+ description : "The name of the map" ,
121
+ } ,
90
122
authors : {
91
123
type : new GraphQLNonNull ( new GraphQLList ( new GraphQLNonNull ( Author ) ) ) ,
124
+ description : "The authors of this map" ,
125
+ } ,
126
+ videos : {
127
+ type : new GraphQLNonNull ( MapVideos ) ,
128
+ description : "Videos showing playthroughs of this map" ,
129
+ } ,
130
+ tiers : {
131
+ type : new GraphQLNonNull ( Tiers ) ,
132
+ description : "The tiers of this map" ,
133
+ } ,
134
+ zones : {
135
+ type : new GraphQLNonNull ( Zones ) ,
136
+ description : "The zones of this map" ,
92
137
} ,
93
- videos : { type : new GraphQLNonNull ( MapVideos ) } ,
94
- tiers : { type : new GraphQLNonNull ( Tiers ) } ,
95
- zones : { type : new GraphQLNonNull ( Zones ) } ,
96
138
records : {
97
139
type : new GraphQLNonNull ( new GraphQLList ( new GraphQLNonNull ( RecordType ) ) ) ,
140
+ description :
141
+ "Player records on this map, filterable by class and zone. Later records can be fetched with a non-empty start argument" ,
98
142
args : {
99
143
zoneType : { type : ZoneTypeEnum } ,
100
144
zoneId : { type : GraphQLInt } ,
@@ -105,6 +149,8 @@ export default new GraphQLObjectType({
105
149
} ,
106
150
record : {
107
151
type : RecordType ,
152
+ description :
153
+ "Fetch a single record on this map by providing the player and class, and optionally a zone. Without a zone, the player's map record will be fetched" ,
108
154
args : {
109
155
zoneType : { type : ZoneTypeEnum } ,
110
156
zoneId : { type : GraphQLInt } ,
@@ -114,6 +160,7 @@ export default new GraphQLObjectType({
114
160
} ,
115
161
wr : {
116
162
type : RecordType ,
163
+ description : "Fetch the world record on this map by class" ,
117
164
args : {
118
165
class : { type : new GraphQLNonNull ( ClassTypeEnum ) } ,
119
166
} ,
0 commit comments