tempus-api-graphql
Version:
A GraphQL wrapper for the tempus api (tempus2.xyz)
160 lines (151 loc) • 3.75 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _graphql = require("graphql");
var _record = _interopRequireDefault(require("./record"));
var _class_type_enum = _interopRequireDefault(require("./class_type_enum"));
var _zone_type_enum = _interopRequireDefault(require("./zone_type_enum"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
var Rank = new _graphql.GraphQLObjectType({
name: "Rank",
fields: function fields() {
return {
points: {
type: new _graphql.GraphQLNonNull(_graphql.GraphQLFloat)
},
rank: {
type: new _graphql.GraphQLNonNull(_graphql.GraphQLInt)
},
totalRanked: {
type: new _graphql.GraphQLNonNull(_graphql.GraphQLInt)
},
title: {
type: _graphql.GraphQLString
}
};
}
});
var Ranks = new _graphql.GraphQLObjectType({
name: "Ranks",
fields: function fields() {
return {
overall: {
type: new _graphql.GraphQLNonNull(Rank)
},
soldier: {
type: new _graphql.GraphQLNonNull(Rank)
},
demoman: {
type: new _graphql.GraphQLNonNull(Rank)
}
};
}
});
var Stat = new _graphql.GraphQLObjectType({
name: "Stat",
fields: function fields() {
return {
count: {
type: new _graphql.GraphQLNonNull(_graphql.GraphQLInt)
},
points: {
type: new _graphql.GraphQLNonNull(_graphql.GraphQLInt)
}
};
}
});
var Stats = new _graphql.GraphQLObjectType({
name: "Stats",
fields: function fields() {
return {
bonus: {
type: new _graphql.GraphQLNonNull(Stat)
},
course: {
type: new _graphql.GraphQLNonNull(Stat)
},
map: {
type: new _graphql.GraphQLNonNull(Stat)
},
trick: {
type: new _graphql.GraphQLNonNull(Stat)
}
};
}
});
var StatsCollection = new _graphql.GraphQLObjectType({
name: "StatsCollection",
fields: function fields() {
return {
pr: {
type: new _graphql.GraphQLNonNull(Stats)
},
wr: {
type: new _graphql.GraphQLNonNull(Stats)
},
top: {
type: new _graphql.GraphQLNonNull(Stats)
}
};
}
});
var _default = new _graphql.GraphQLObjectType({
name: "Player",
fields: function fields() {
return {
id: {
type: new _graphql.GraphQLNonNull(_graphql.GraphQLInt)
},
name: {
type: new _graphql.GraphQLNonNull(_graphql.GraphQLString)
},
country: {
type: _graphql.GraphQLString
},
countryCode: {
type: _graphql.GraphQLString
},
steamId: {
type: new _graphql.GraphQLNonNull(_graphql.GraphQLString)
},
firstSeen: {
type: new _graphql.GraphQLNonNull(_graphql.GraphQLFloat)
},
lastSeen: {
type: new _graphql.GraphQLNonNull(_graphql.GraphQLFloat)
},
ranks: {
type: new _graphql.GraphQLNonNull(Ranks)
},
countryRanks: {
type: new _graphql.GraphQLNonNull(Ranks)
},
stats: {
type: new _graphql.GraphQLNonNull(StatsCollection)
},
record: {
type: _record["default"],
args: {
mapId: {
type: _graphql.GraphQLInt
},
mapName: {
type: _graphql.GraphQLString
},
zoneType: {
type: _zone_type_enum["default"]
},
zoneId: {
type: _graphql.GraphQLInt
},
"class": {
type: new _graphql.GraphQLNonNull(_class_type_enum["default"])
}
}
}
};
}
});
exports["default"] = _default;