@@ -14,29 +14,44 @@ import ClassTypeEnum from "./class_type_enum";
1414
1515const Author = new GraphQLObjectType ( {
1616 name : "Author" ,
17+ description : "An author of a map" ,
1718
1819 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+ } ,
2128 mapCount : {
2229 type : new GraphQLNonNull ( GraphQLInt ) ,
30+ description : "The number of maps this author has created" ,
2331 resolve : ( author ) => author . map_count ,
2432 } ,
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+ } ,
2638 } ) ,
2739} ) ;
2840
2941const MapVideos = new GraphQLObjectType ( {
3042 name : "MapVideos" ,
43+ description : "The videos with playthroughs of a map" ,
3144
3245 fields : ( ) => ( {
3346 soldier : {
3447 type : GraphQLString ,
48+ description : "The URL for the video of a soldier playthrough of a map" ,
3549 resolve : ( videos ) =>
3650 videos . soldier && `https://youtube.com/watch?v=${ videos . soldier } ` ,
3751 } ,
3852 demoman : {
3953 type : GraphQLString ,
54+ description : "The URL for the video of a demoman playthrough of a map" ,
4055 resolve : ( videos ) =>
4156 videos . demoman && `https://youtube.com/watch?v=${ videos . demoman } ` ,
4257 } ,
@@ -45,37 +60,48 @@ const MapVideos = new GraphQLObjectType({
4560
4661const Zones = new GraphQLObjectType ( {
4762 name : "Zones" ,
63+ description : "The zones for a map" ,
4864
4965 fields : ( ) => ( {
5066 bonus : {
5167 type : new GraphQLNonNull ( new GraphQLList ( new GraphQLNonNull ( ZoneType ) ) ) ,
68+ description : "The bonus zones for a map" ,
5269 } ,
5370 bonusEnd : {
5471 type : new GraphQLNonNull ( new GraphQLList ( new GraphQLNonNull ( ZoneType ) ) ) ,
72+ description : "The bonus end zones for a map" ,
5573 } ,
5674 checkpoint : {
5775 type : new GraphQLNonNull ( new GraphQLList ( new GraphQLNonNull ( ZoneType ) ) ) ,
76+ description : "The checkpoint zones for a map" ,
5877 } ,
5978 course : {
6079 type : new GraphQLNonNull ( new GraphQLList ( new GraphQLNonNull ( ZoneType ) ) ) ,
80+ description : "The course zones for a map" ,
6181 } ,
6282 courseEnd : {
6383 type : new GraphQLNonNull ( new GraphQLList ( new GraphQLNonNull ( ZoneType ) ) ) ,
84+ description : "The course end zones for a map" ,
6485 } ,
6586 linear : {
6687 type : new GraphQLNonNull ( new GraphQLList ( new GraphQLNonNull ( ZoneType ) ) ) ,
88+ description : "The linear zones for a map" ,
6789 } ,
6890 map : {
6991 type : new GraphQLNonNull ( new GraphQLList ( new GraphQLNonNull ( ZoneType ) ) ) ,
92+ description : "The map zones for a map" ,
7093 } ,
7194 mapEnd : {
7295 type : new GraphQLNonNull ( new GraphQLList ( new GraphQLNonNull ( ZoneType ) ) ) ,
96+ description : "The end zones for a map" ,
7397 } ,
7498 misc : {
7599 type : new GraphQLNonNull ( new GraphQLList ( new GraphQLNonNull ( ZoneType ) ) ) ,
100+ description : "The miscellaneous zones for a map" ,
76101 } ,
77102 trick : {
78103 type : new GraphQLNonNull ( new GraphQLList ( new GraphQLNonNull ( ZoneType ) ) ) ,
104+ description : "The trick zones for a map" ,
79105 } ,
80106 } ) ,
81107} ) ;
@@ -85,16 +111,34 @@ export default new GraphQLObjectType({
85111 description : "A jump map" ,
86112
87113 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+ } ,
90122 authors : {
91123 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" ,
92137 } ,
93- videos : { type : new GraphQLNonNull ( MapVideos ) } ,
94- tiers : { type : new GraphQLNonNull ( Tiers ) } ,
95- zones : { type : new GraphQLNonNull ( Zones ) } ,
96138 records : {
97139 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" ,
98142 args : {
99143 zoneType : { type : ZoneTypeEnum } ,
100144 zoneId : { type : GraphQLInt } ,
@@ -105,6 +149,8 @@ export default new GraphQLObjectType({
105149 } ,
106150 record : {
107151 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" ,
108154 args : {
109155 zoneType : { type : ZoneTypeEnum } ,
110156 zoneId : { type : GraphQLInt } ,
@@ -114,6 +160,7 @@ export default new GraphQLObjectType({
114160 } ,
115161 wr : {
116162 type : RecordType ,
163+ description : "Fetch the world record on this map by class" ,
117164 args : {
118165 class : { type : new GraphQLNonNull ( ClassTypeEnum ) } ,
119166 } ,
0 commit comments