mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-05-09 12:13:10 -05:00
backend for xRankPlacements get
This commit is contained in:
parent
9d55327ed5
commit
b903ebac67
|
|
@ -1,12 +1,13 @@
|
|||
import { makeSchema } from "@nexus/schema";
|
||||
import * as userTypes from "graphql/schema/user";
|
||||
import { nexusSchemaPrisma } from "nexus-plugin-prisma/schema";
|
||||
import * as xRankPlacementTypes from "graphql/schema/xRankPlacement";
|
||||
import { nexusPrisma } from "nexus-plugin-prisma";
|
||||
import path from "path";
|
||||
|
||||
export const schema = makeSchema({
|
||||
types: [userTypes],
|
||||
types: [userTypes, xRankPlacementTypes],
|
||||
// FIXME: set complexity plugin
|
||||
plugins: [nexusSchemaPrisma()],
|
||||
plugins: [nexusPrisma({ experimentalCRUD: true })],
|
||||
outputs: {
|
||||
// FIXME: should be in graphql/generated instead root
|
||||
schema: path.join(process.cwd(), "schema.graphql"),
|
||||
|
|
|
|||
55
graphql/schema/xRankPlacement.ts
Normal file
55
graphql/schema/xRankPlacement.ts
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
import { extendType, objectType } from "@nexus/schema";
|
||||
|
||||
export const XRankPlacmement = objectType({
|
||||
name: "XRankPlacement",
|
||||
definition(t) {
|
||||
t.model.id();
|
||||
t.model.playerId();
|
||||
t.model.playerName();
|
||||
t.model.ranking();
|
||||
t.model.xPower();
|
||||
t.model.weapon();
|
||||
t.model.mode();
|
||||
t.model.month();
|
||||
t.model.year();
|
||||
t.model.player();
|
||||
},
|
||||
});
|
||||
|
||||
export const Player = objectType({
|
||||
name: "Player",
|
||||
definition(t) {
|
||||
t.model.playerId();
|
||||
t.model.names({
|
||||
description:
|
||||
"Set of names player has had in Top 500 results. The most recent one is the first one of the list.",
|
||||
});
|
||||
t.model.user();
|
||||
t.model.placements();
|
||||
},
|
||||
});
|
||||
|
||||
// FIXME: also extendType in user.ts
|
||||
export const Query = extendType({
|
||||
type: "Query",
|
||||
definition(t) {
|
||||
// TODO: limit so that you can only get max 100 results max and 50 by default
|
||||
t.crud.xRankPlacements({
|
||||
ordering: { ranking: true, month: true, year: true },
|
||||
async resolve(
|
||||
root: any,
|
||||
args: any,
|
||||
ctx: any,
|
||||
info: any,
|
||||
originalResolve: any
|
||||
) {
|
||||
console.log({ args: args.orderBy });
|
||||
if (!args.first && !args.last) args.first = 50;
|
||||
|
||||
args.first = Math.min(args.first, 100);
|
||||
args.last = Math.min(args.last, 100);
|
||||
return originalResolve(root, args, ctx, info);
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
114
nexus-typegen.ts
114
nexus-typegen.ts
|
|
@ -10,8 +10,8 @@ import * as Prisma from ".prisma/client"
|
|||
|
||||
declare global {
|
||||
interface NexusGenCustomOutputProperties<TypeName extends string> {
|
||||
crud: NexusPrisma<TypeName, 'crud'>
|
||||
model: NexusPrisma<TypeName, 'model'>
|
||||
crud: any
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -20,6 +20,17 @@ declare global {
|
|||
}
|
||||
|
||||
export interface NexusGenInputs {
|
||||
PlayerIdModeMonthYearCompoundUniqueInput: { // input type
|
||||
mode: NexusGenEnums['RankedMode']; // RankedMode!
|
||||
month: number; // Int!
|
||||
playerId: string; // String!
|
||||
year: number; // Int!
|
||||
}
|
||||
QueryXRankPlacementsOrderByInput: { // input type
|
||||
month?: NexusGenEnums['SortOrder'] | null; // SortOrder
|
||||
ranking?: NexusGenEnums['SortOrder'] | null; // SortOrder
|
||||
year?: NexusGenEnums['SortOrder'] | null; // SortOrder
|
||||
}
|
||||
UpdateUserProfileInput: { // input type
|
||||
bio?: string | null; // String
|
||||
country?: string | null; // String
|
||||
|
|
@ -31,9 +42,15 @@ export interface NexusGenInputs {
|
|||
weaponPool: string[]; // [String!]!
|
||||
youtubeId?: string | null; // String
|
||||
}
|
||||
XRankPlacementWhereUniqueInput: { // input type
|
||||
id?: number | null; // Int
|
||||
playerId_mode_month_year?: NexusGenInputs['PlayerIdModeMonthYearCompoundUniqueInput'] | null; // PlayerIdModeMonthYearCompoundUniqueInput
|
||||
}
|
||||
}
|
||||
|
||||
export interface NexusGenEnums {
|
||||
RankedMode: Prisma.RankedMode
|
||||
SortOrder: Prisma.SortOrder
|
||||
}
|
||||
|
||||
export interface NexusGenScalars {
|
||||
|
|
@ -46,13 +63,20 @@ export interface NexusGenScalars {
|
|||
|
||||
export interface NexusGenRootTypes {
|
||||
Mutation: {};
|
||||
Player: Prisma.Player;
|
||||
Profile: Prisma.Profile;
|
||||
Query: {};
|
||||
User: Prisma.User;
|
||||
XRankPlacement: Prisma.XRankPlacement;
|
||||
}
|
||||
|
||||
export interface NexusGenAllTypes extends NexusGenRootTypes {
|
||||
PlayerIdModeMonthYearCompoundUniqueInput: NexusGenInputs['PlayerIdModeMonthYearCompoundUniqueInput'];
|
||||
QueryXRankPlacementsOrderByInput: NexusGenInputs['QueryXRankPlacementsOrderByInput'];
|
||||
UpdateUserProfileInput: NexusGenInputs['UpdateUserProfileInput'];
|
||||
XRankPlacementWhereUniqueInput: NexusGenInputs['XRankPlacementWhereUniqueInput'];
|
||||
RankedMode: NexusGenEnums['RankedMode'];
|
||||
SortOrder: NexusGenEnums['SortOrder'];
|
||||
String: NexusGenScalars['String'];
|
||||
Int: NexusGenScalars['Int'];
|
||||
Float: NexusGenScalars['Float'];
|
||||
|
|
@ -64,6 +88,12 @@ export interface NexusGenFieldTypes {
|
|||
Mutation: { // field return type
|
||||
updateUserProfile: boolean; // Boolean!
|
||||
}
|
||||
Player: { // field return type
|
||||
names: string[]; // [String!]!
|
||||
placements: NexusGenRootTypes['XRankPlacement'][]; // [XRankPlacement!]!
|
||||
playerId: string; // String!
|
||||
user: NexusGenRootTypes['User'] | null; // User
|
||||
}
|
||||
Profile: { // field return type
|
||||
bio: string | null; // String
|
||||
country: string | null; // String
|
||||
|
|
@ -77,6 +107,7 @@ export interface NexusGenFieldTypes {
|
|||
}
|
||||
Query: { // field return type
|
||||
getUserByIdentifier: NexusGenRootTypes['User'] | null; // User
|
||||
xRankPlacements: NexusGenRootTypes['XRankPlacement'][]; // [XRankPlacement!]!
|
||||
}
|
||||
User: { // field return type
|
||||
avatarUrl: string | null; // String
|
||||
|
|
@ -86,6 +117,65 @@ export interface NexusGenFieldTypes {
|
|||
profile: NexusGenRootTypes['Profile'] | null; // Profile
|
||||
profilePath: string; // String!
|
||||
}
|
||||
XRankPlacement: { // field return type
|
||||
id: number; // Int!
|
||||
mode: NexusGenEnums['RankedMode']; // RankedMode!
|
||||
month: number; // Int!
|
||||
player: NexusGenRootTypes['Player']; // Player!
|
||||
playerId: string; // String!
|
||||
playerName: string; // String!
|
||||
ranking: number; // Int!
|
||||
weapon: string; // String!
|
||||
xPower: number; // Float!
|
||||
year: number; // Int!
|
||||
}
|
||||
}
|
||||
|
||||
export interface NexusGenFieldTypeNames {
|
||||
Mutation: { // field return type name
|
||||
updateUserProfile: 'Boolean'
|
||||
}
|
||||
Player: { // field return type name
|
||||
names: 'String'
|
||||
placements: 'XRankPlacement'
|
||||
playerId: 'String'
|
||||
user: 'User'
|
||||
}
|
||||
Profile: { // field return type name
|
||||
bio: 'String'
|
||||
country: 'String'
|
||||
customUrlPath: 'String'
|
||||
sensMotion: 'Float'
|
||||
sensStick: 'Float'
|
||||
twitchName: 'String'
|
||||
twitterName: 'String'
|
||||
weaponPool: 'String'
|
||||
youtubeId: 'String'
|
||||
}
|
||||
Query: { // field return type name
|
||||
getUserByIdentifier: 'User'
|
||||
xRankPlacements: 'XRankPlacement'
|
||||
}
|
||||
User: { // field return type name
|
||||
avatarUrl: 'String'
|
||||
discordId: 'String'
|
||||
fullUsername: 'String'
|
||||
id: 'Int'
|
||||
profile: 'Profile'
|
||||
profilePath: 'String'
|
||||
}
|
||||
XRankPlacement: { // field return type name
|
||||
id: 'Int'
|
||||
mode: 'RankedMode'
|
||||
month: 'Int'
|
||||
player: 'Player'
|
||||
playerId: 'String'
|
||||
playerName: 'String'
|
||||
ranking: 'Int'
|
||||
weapon: 'String'
|
||||
xPower: 'Float'
|
||||
year: 'Int'
|
||||
}
|
||||
}
|
||||
|
||||
export interface NexusGenArgTypes {
|
||||
|
|
@ -94,10 +184,25 @@ export interface NexusGenArgTypes {
|
|||
profile: NexusGenInputs['UpdateUserProfileInput']; // UpdateUserProfileInput!
|
||||
}
|
||||
}
|
||||
Player: {
|
||||
placements: { // args
|
||||
after?: NexusGenInputs['XRankPlacementWhereUniqueInput'] | null; // XRankPlacementWhereUniqueInput
|
||||
before?: NexusGenInputs['XRankPlacementWhereUniqueInput'] | null; // XRankPlacementWhereUniqueInput
|
||||
first?: number | null; // Int
|
||||
last?: number | null; // Int
|
||||
}
|
||||
}
|
||||
Query: {
|
||||
getUserByIdentifier: { // args
|
||||
identifier: string; // String!
|
||||
}
|
||||
xRankPlacements: { // args
|
||||
after?: NexusGenInputs['XRankPlacementWhereUniqueInput'] | null; // XRankPlacementWhereUniqueInput
|
||||
before?: NexusGenInputs['XRankPlacementWhereUniqueInput'] | null; // XRankPlacementWhereUniqueInput
|
||||
first?: number | null; // Int
|
||||
last?: number | null; // Int
|
||||
orderBy?: NexusGenInputs['QueryXRankPlacementsOrderByInput'][] | null; // [QueryXRankPlacementsOrderByInput!]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -106,11 +211,11 @@ export interface NexusGenAbstractResolveReturnTypes {
|
|||
|
||||
export interface NexusGenInheritedFields {}
|
||||
|
||||
export type NexusGenObjectNames = "Mutation" | "Profile" | "Query" | "User";
|
||||
export type NexusGenObjectNames = "Mutation" | "Player" | "Profile" | "Query" | "User" | "XRankPlacement";
|
||||
|
||||
export type NexusGenInputNames = "UpdateUserProfileInput";
|
||||
export type NexusGenInputNames = "PlayerIdModeMonthYearCompoundUniqueInput" | "QueryXRankPlacementsOrderByInput" | "UpdateUserProfileInput" | "XRankPlacementWhereUniqueInput";
|
||||
|
||||
export type NexusGenEnumNames = never;
|
||||
export type NexusGenEnumNames = "RankedMode" | "SortOrder";
|
||||
|
||||
export type NexusGenInterfaceNames = never;
|
||||
|
||||
|
|
@ -124,6 +229,7 @@ export interface NexusGenTypes {
|
|||
rootTypes: NexusGenRootTypes;
|
||||
argTypes: NexusGenArgTypes;
|
||||
fieldTypes: NexusGenFieldTypes;
|
||||
fieldTypeNames: NexusGenFieldTypeNames;
|
||||
allTypes: NexusGenAllTypes;
|
||||
inheritedFields: NexusGenInheritedFields;
|
||||
objectNames: NexusGenObjectNames;
|
||||
|
|
|
|||
154
package-lock.json
generated
154
package-lock.json
generated
|
|
@ -13,7 +13,7 @@
|
|||
"@chakra-ui/theme-tools": "^1.0.0-rc.7",
|
||||
"@hookform/resolvers": "^1.0.0",
|
||||
"@nexus/schema": "^0.17.0",
|
||||
"@prisma/client": "^2.10.0",
|
||||
"@prisma/client": "^2.10.1",
|
||||
"@sendou/react-sketch": "^0.5.2",
|
||||
"apollo-server-micro": "^2.18.2",
|
||||
"countries-list": "^2.5.6",
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
"next-auth": "^3.1.0",
|
||||
"next-google-fonts": "^1.2.1",
|
||||
"next-images": "^1.6.2",
|
||||
"nexus-plugin-prisma": "^0.23.0",
|
||||
"nexus-plugin-prisma": "^0.23.1",
|
||||
"react": "^17.0.1",
|
||||
"react-dom": "^17.0.1",
|
||||
"react-draggable": "^4.4.3",
|
||||
|
|
@ -39,7 +39,7 @@
|
|||
"@graphql-codegen/typescript": "1.17.11",
|
||||
"@graphql-codegen/typescript-operations": "1.17.8",
|
||||
"@graphql-codegen/typescript-react-apollo": "2.0.7",
|
||||
"@prisma/cli": "^2.10.0",
|
||||
"@prisma/cli": "^2.10.1",
|
||||
"@types/next-auth": "^3.1.14",
|
||||
"@types/node": "^14.14.6",
|
||||
"@types/react": "^16.9.55",
|
||||
|
|
@ -3606,17 +3606,17 @@
|
|||
"version": "0.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@prisma/bar/-/bar-0.0.0.tgz",
|
||||
"integrity": "sha512-3nez9n/vMyAr4+nmqj6Xh3cGZbreYHr3RWX0vgtrFRpiN6otuCzL+9HW8MW/DfZNuFz5YyIdfwnRSPueUZPoWQ==",
|
||||
"devOptional": true
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@prisma/cli": {
|
||||
"version": "2.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@prisma/cli/-/cli-2.10.0.tgz",
|
||||
"integrity": "sha512-qJl891HvroM1oEWYeG8+h/JJ+wNi4MCyh7x+HAnmrIYGFW45QAsCWjHbn0mUuCSXCy3KwiN/iAwaY2Fr7ZNJEw==",
|
||||
"devOptional": true,
|
||||
"version": "2.10.1",
|
||||
"resolved": "https://registry.npmjs.org/@prisma/cli/-/cli-2.10.1.tgz",
|
||||
"integrity": "sha512-I+51GBJyuGS5xsCl8pf4XfTt9HIdhCJQoaGCA9KLDzVRbFHElMQ++hhyhLohJ4buFZlSagIq8NI8yIC5yu+Wkg==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"dependencies": {
|
||||
"@prisma/bar": "^0.0.0",
|
||||
"@prisma/engines": "2.10.0-16-af1ae11a423edfb5d24092a85be11fa77c5e499c"
|
||||
"@prisma/engines": "2.10.1-6-7d0087eadc7265e12d4b8d8c3516b02c4c965111"
|
||||
},
|
||||
"bin": {
|
||||
"prisma": "build/index.js",
|
||||
|
|
@ -3627,12 +3627,12 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@prisma/client": {
|
||||
"version": "2.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@prisma/client/-/client-2.10.0.tgz",
|
||||
"integrity": "sha512-TZoT5SYmCkVqMt8rKp3NAUm6UTqjNUMp2W94IcVn2d5DVkOR5TZGkxP/u8KuSoY3KQWIG+KQy/azIKetKxc+LQ==",
|
||||
"version": "2.10.1",
|
||||
"resolved": "https://registry.npmjs.org/@prisma/client/-/client-2.10.1.tgz",
|
||||
"integrity": "sha512-VwasxCCwdRmrcVVoLwXTEbwrBiqOYr2Umqw9btvMvHGRhA1nRKCvmt7SCiCjGrx6CuC8eCG/HGxruv04001YKQ==",
|
||||
"hasInstallScript": true,
|
||||
"dependencies": {
|
||||
"@prisma/engines-version": "2.10.0-16-af1ae11a423edfb5d24092a85be11fa77c5e499c"
|
||||
"@prisma/engines-version": "2.10.1-6-7d0087eadc7265e12d4b8d8c3516b02c4c965111"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
|
|
@ -3647,16 +3647,16 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@prisma/engines": {
|
||||
"version": "2.10.0-16-af1ae11a423edfb5d24092a85be11fa77c5e499c",
|
||||
"resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-2.10.0-16-af1ae11a423edfb5d24092a85be11fa77c5e499c.tgz",
|
||||
"integrity": "sha512-59htYpsqdVVe7aElozUZ3/eV/ujwrUvaE+KVcNyzFh0yFIL7FLbSly55KWlyUdDWyB+0eTyd/yV7E/iKYnOF/Q==",
|
||||
"devOptional": true,
|
||||
"version": "2.10.1-6-7d0087eadc7265e12d4b8d8c3516b02c4c965111",
|
||||
"resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-2.10.1-6-7d0087eadc7265e12d4b8d8c3516b02c4c965111.tgz",
|
||||
"integrity": "sha512-F/I8mmYMQnEFX47jl7Su8Pmvpua1wti9Uq3IUlSCqLQsrOmuMj+GKQ5nYEewmcynqBlyVcpUyxF5iAWbmUVdjw==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true
|
||||
},
|
||||
"node_modules/@prisma/engines-version": {
|
||||
"version": "2.10.0-16-af1ae11a423edfb5d24092a85be11fa77c5e499c",
|
||||
"resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-2.10.0-16-af1ae11a423edfb5d24092a85be11fa77c5e499c.tgz",
|
||||
"integrity": "sha512-8dW/oSDBv3fovNzTn2sjpITgD4IhHYPnmkbPp4Gv4rqjB14tpB0OuU1xkygVRIRJisTBRoYyjfiVaaWea/e57A=="
|
||||
"version": "2.10.1-6-7d0087eadc7265e12d4b8d8c3516b02c4c965111",
|
||||
"resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-2.10.1-6-7d0087eadc7265e12d4b8d8c3516b02c4c965111.tgz",
|
||||
"integrity": "sha512-OuOSTvEzXJwCJzNqZ9N/+J3lO64HgX9uGiVOuvlTrRSXoLZk0Q2IiLAx8qhY1U7jPpHJ7LTlZuGNScimqonpJg=="
|
||||
},
|
||||
"node_modules/@protobufjs/aspromise": {
|
||||
"version": "1.1.2",
|
||||
|
|
@ -4122,7 +4122,8 @@
|
|||
"node_modules/@types/prop-types": {
|
||||
"version": "15.7.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.3.tgz",
|
||||
"integrity": "sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw=="
|
||||
"integrity": "sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/qs": {
|
||||
"version": "6.9.5",
|
||||
|
|
@ -4138,6 +4139,7 @@
|
|||
"version": "16.9.55",
|
||||
"resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.55.tgz",
|
||||
"integrity": "sha512-6KLe6lkILeRwyyy7yG9rULKJ0sXplUsl98MGoCfpteXf9sPWFWWMknDcsvubcpaTdBuxtsLF6HDUwdApZL/xIg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/prop-types": "*",
|
||||
"csstype": "^3.0.2"
|
||||
|
|
@ -11192,16 +11194,17 @@
|
|||
}
|
||||
},
|
||||
"node_modules/nexus-plugin-prisma": {
|
||||
"version": "0.23.0",
|
||||
"resolved": "https://registry.npmjs.org/nexus-plugin-prisma/-/nexus-plugin-prisma-0.23.0.tgz",
|
||||
"integrity": "sha512-RHdEqEyPCI5g9Evzg/dMm45joVHkk1TPNobDZY20SA1PgU41qmMzYqOZammhiIYaJuYkdt0JxUCS73kt3fcDGg==",
|
||||
"version": "0.23.1",
|
||||
"resolved": "https://registry.npmjs.org/nexus-plugin-prisma/-/nexus-plugin-prisma-0.23.1.tgz",
|
||||
"integrity": "sha512-cSH7BBUtxneLhD6BuGoOAG8uwjOExUfBnqA2LnJlkKP9BX4wG59Oe3LaJZfeiYqs0wex7yMeaN+9/uXIdKEJrA==",
|
||||
"hasInstallScript": true,
|
||||
"dependencies": {
|
||||
"camelcase": "^6.0.0",
|
||||
"fs-jetpack": "^4.0.0",
|
||||
"lodash": "^4.17.20",
|
||||
"outdent": "^0.7.1",
|
||||
"pluralize": "^8.0.0"
|
||||
"pluralize": "^8.0.0",
|
||||
"semver": "^7.3.2"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@nexus/schema": "^0.15.0 || ^0.16.0 || ^0.17.0",
|
||||
|
|
@ -11209,6 +11212,17 @@
|
|||
"graphql": "^15.3.0"
|
||||
}
|
||||
},
|
||||
"node_modules/nexus-plugin-prisma/node_modules/semver": {
|
||||
"version": "7.3.2",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz",
|
||||
"integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==",
|
||||
"bin": {
|
||||
"semver": "bin/semver.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/no-case": {
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.3.tgz",
|
||||
|
|
@ -18410,8 +18424,7 @@
|
|||
"@chakra-ui/css-reset": {
|
||||
"version": "1.0.0-rc.7",
|
||||
"resolved": "https://registry.npmjs.org/@chakra-ui/css-reset/-/css-reset-1.0.0-rc.7.tgz",
|
||||
"integrity": "sha512-Om/ipNLc3b43ALcwMLLK6j2ET4jhipm1npl2z37zPdHvBGsutI2gC/pHqiNBX6Yy6iOFMleTs8MNHyQF4D0BYg==",
|
||||
"requires": {}
|
||||
"integrity": "sha512-Om/ipNLc3b43ALcwMLLK6j2ET4jhipm1npl2z37zPdHvBGsutI2gC/pHqiNBX6Yy6iOFMleTs8MNHyQF4D0BYg=="
|
||||
},
|
||||
"@chakra-ui/descendant": {
|
||||
"version": "1.0.0-rc.7",
|
||||
|
|
@ -19641,8 +19654,7 @@
|
|||
"@graphql-typed-document-node/core": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@graphql-typed-document-node/core/-/core-3.1.0.tgz",
|
||||
"integrity": "sha512-wYn6r8zVZyQJ6rQaALBEln5B1pzxb9shV5Ef97kTvn6yVGrqyXVnDqnU24MXnFubR+rZjBY9NWuxX3FB2sTsjg==",
|
||||
"requires": {}
|
||||
"integrity": "sha512-wYn6r8zVZyQJ6rQaALBEln5B1pzxb9shV5Ef97kTvn6yVGrqyXVnDqnU24MXnFubR+rZjBY9NWuxX3FB2sTsjg=="
|
||||
},
|
||||
"@hapi/accept": {
|
||||
"version": "5.0.1",
|
||||
|
|
@ -19669,8 +19681,7 @@
|
|||
"@hookform/resolvers": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@hookform/resolvers/-/resolvers-1.0.0.tgz",
|
||||
"integrity": "sha512-YzBq6ZFw/uWGa3rXBNSHqnsE4hDXLrzdboDxPRKGjYHVzs1dBxjvELftP8iTmRPqP32VjnbVfUktX1CQ6Y7sog==",
|
||||
"requires": {}
|
||||
"integrity": "sha512-YzBq6ZFw/uWGa3rXBNSHqnsE4hDXLrzdboDxPRKGjYHVzs1dBxjvELftP8iTmRPqP32VjnbVfUktX1CQ6Y7sog=="
|
||||
},
|
||||
"@next/env": {
|
||||
"version": "10.0.0",
|
||||
|
|
@ -19721,8 +19732,7 @@
|
|||
"@next/react-refresh-utils": {
|
||||
"version": "10.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@next/react-refresh-utils/-/react-refresh-utils-10.0.0.tgz",
|
||||
"integrity": "sha512-V1/oiDWb2C1Do0eZONsKX1aqGNkqCUqxUahIiCjwKFu9c3bps+Ygg4JjtaCd9oycv0KzYImUZnU+nqveFUjxUw==",
|
||||
"requires": {}
|
||||
"integrity": "sha512-V1/oiDWb2C1Do0eZONsKX1aqGNkqCUqxUahIiCjwKFu9c3bps+Ygg4JjtaCd9oycv0KzYImUZnU+nqveFUjxUw=="
|
||||
},
|
||||
"@nexus/schema": {
|
||||
"version": "0.17.0",
|
||||
|
|
@ -19781,36 +19791,36 @@
|
|||
"version": "0.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@prisma/bar/-/bar-0.0.0.tgz",
|
||||
"integrity": "sha512-3nez9n/vMyAr4+nmqj6Xh3cGZbreYHr3RWX0vgtrFRpiN6otuCzL+9HW8MW/DfZNuFz5YyIdfwnRSPueUZPoWQ==",
|
||||
"devOptional": true
|
||||
"dev": true
|
||||
},
|
||||
"@prisma/cli": {
|
||||
"version": "2.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@prisma/cli/-/cli-2.10.0.tgz",
|
||||
"integrity": "sha512-qJl891HvroM1oEWYeG8+h/JJ+wNi4MCyh7x+HAnmrIYGFW45QAsCWjHbn0mUuCSXCy3KwiN/iAwaY2Fr7ZNJEw==",
|
||||
"devOptional": true,
|
||||
"version": "2.10.1",
|
||||
"resolved": "https://registry.npmjs.org/@prisma/cli/-/cli-2.10.1.tgz",
|
||||
"integrity": "sha512-I+51GBJyuGS5xsCl8pf4XfTt9HIdhCJQoaGCA9KLDzVRbFHElMQ++hhyhLohJ4buFZlSagIq8NI8yIC5yu+Wkg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@prisma/bar": "^0.0.0",
|
||||
"@prisma/engines": "2.10.0-16-af1ae11a423edfb5d24092a85be11fa77c5e499c"
|
||||
"@prisma/engines": "2.10.1-6-7d0087eadc7265e12d4b8d8c3516b02c4c965111"
|
||||
}
|
||||
},
|
||||
"@prisma/client": {
|
||||
"version": "2.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@prisma/client/-/client-2.10.0.tgz",
|
||||
"integrity": "sha512-TZoT5SYmCkVqMt8rKp3NAUm6UTqjNUMp2W94IcVn2d5DVkOR5TZGkxP/u8KuSoY3KQWIG+KQy/azIKetKxc+LQ==",
|
||||
"version": "2.10.1",
|
||||
"resolved": "https://registry.npmjs.org/@prisma/client/-/client-2.10.1.tgz",
|
||||
"integrity": "sha512-VwasxCCwdRmrcVVoLwXTEbwrBiqOYr2Umqw9btvMvHGRhA1nRKCvmt7SCiCjGrx6CuC8eCG/HGxruv04001YKQ==",
|
||||
"requires": {
|
||||
"@prisma/engines-version": "2.10.0-16-af1ae11a423edfb5d24092a85be11fa77c5e499c"
|
||||
"@prisma/engines-version": "2.10.1-6-7d0087eadc7265e12d4b8d8c3516b02c4c965111"
|
||||
}
|
||||
},
|
||||
"@prisma/engines": {
|
||||
"version": "2.10.0-16-af1ae11a423edfb5d24092a85be11fa77c5e499c",
|
||||
"resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-2.10.0-16-af1ae11a423edfb5d24092a85be11fa77c5e499c.tgz",
|
||||
"integrity": "sha512-59htYpsqdVVe7aElozUZ3/eV/ujwrUvaE+KVcNyzFh0yFIL7FLbSly55KWlyUdDWyB+0eTyd/yV7E/iKYnOF/Q==",
|
||||
"devOptional": true
|
||||
"version": "2.10.1-6-7d0087eadc7265e12d4b8d8c3516b02c4c965111",
|
||||
"resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-2.10.1-6-7d0087eadc7265e12d4b8d8c3516b02c4c965111.tgz",
|
||||
"integrity": "sha512-F/I8mmYMQnEFX47jl7Su8Pmvpua1wti9Uq3IUlSCqLQsrOmuMj+GKQ5nYEewmcynqBlyVcpUyxF5iAWbmUVdjw==",
|
||||
"dev": true
|
||||
},
|
||||
"@prisma/engines-version": {
|
||||
"version": "2.10.0-16-af1ae11a423edfb5d24092a85be11fa77c5e499c",
|
||||
"resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-2.10.0-16-af1ae11a423edfb5d24092a85be11fa77c5e499c.tgz",
|
||||
"integrity": "sha512-8dW/oSDBv3fovNzTn2sjpITgD4IhHYPnmkbPp4Gv4rqjB14tpB0OuU1xkygVRIRJisTBRoYyjfiVaaWea/e57A=="
|
||||
"version": "2.10.1-6-7d0087eadc7265e12d4b8d8c3516b02c4c965111",
|
||||
"resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-2.10.1-6-7d0087eadc7265e12d4b8d8c3516b02c4c965111.tgz",
|
||||
"integrity": "sha512-OuOSTvEzXJwCJzNqZ9N/+J3lO64HgX9uGiVOuvlTrRSXoLZk0Q2IiLAx8qhY1U7jPpHJ7LTlZuGNScimqonpJg=="
|
||||
},
|
||||
"@protobufjs/aspromise": {
|
||||
"version": "1.1.2",
|
||||
|
|
@ -20241,7 +20251,8 @@
|
|||
"@types/prop-types": {
|
||||
"version": "15.7.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.3.tgz",
|
||||
"integrity": "sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw=="
|
||||
"integrity": "sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/qs": {
|
||||
"version": "6.9.5",
|
||||
|
|
@ -20257,6 +20268,7 @@
|
|||
"version": "16.9.55",
|
||||
"resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.55.tgz",
|
||||
"integrity": "sha512-6KLe6lkILeRwyyy7yG9rULKJ0sXplUsl98MGoCfpteXf9sPWFWWMknDcsvubcpaTdBuxtsLF6HDUwdApZL/xIg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/prop-types": "*",
|
||||
"csstype": "^3.0.2"
|
||||
|
|
@ -20565,14 +20577,12 @@
|
|||
"ajv-errors": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.1.tgz",
|
||||
"integrity": "sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ==",
|
||||
"requires": {}
|
||||
"integrity": "sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ=="
|
||||
},
|
||||
"ajv-keywords": {
|
||||
"version": "3.5.2",
|
||||
"resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz",
|
||||
"integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==",
|
||||
"requires": {}
|
||||
"integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ=="
|
||||
},
|
||||
"ally.js": {
|
||||
"version": "1.4.1",
|
||||
|
|
@ -20740,8 +20750,7 @@
|
|||
"apollo-server-errors": {
|
||||
"version": "2.4.2",
|
||||
"resolved": "https://registry.npmjs.org/apollo-server-errors/-/apollo-server-errors-2.4.2.tgz",
|
||||
"integrity": "sha512-FeGxW3Batn6sUtX3OVVUm7o56EgjxDlmgpTLNyWcLb0j6P8mw9oLNyAm3B+deHA4KNdNHO5BmHS2g1SJYjqPCQ==",
|
||||
"requires": {}
|
||||
"integrity": "sha512-FeGxW3Batn6sUtX3OVVUm7o56EgjxDlmgpTLNyWcLb0j6P8mw9oLNyAm3B+deHA4KNdNHO5BmHS2g1SJYjqPCQ=="
|
||||
},
|
||||
"apollo-server-micro": {
|
||||
"version": "2.18.2",
|
||||
|
|
@ -23888,8 +23897,7 @@
|
|||
"graphql-tag": {
|
||||
"version": "2.11.0",
|
||||
"resolved": "https://registry.npmjs.org/graphql-tag/-/graphql-tag-2.11.0.tgz",
|
||||
"integrity": "sha512-VmsD5pJqWJnQZMUeRwrDhfgoyqcfwEkvtpANqcoUG8/tOLkwNgU9mzub/Mc78OJMhHjx7gfAMTxzdG43VGg3bA==",
|
||||
"requires": {}
|
||||
"integrity": "sha512-VmsD5pJqWJnQZMUeRwrDhfgoyqcfwEkvtpANqcoUG8/tOLkwNgU9mzub/Mc78OJMhHjx7gfAMTxzdG43VGg3bA=="
|
||||
},
|
||||
"graphql-tools": {
|
||||
"version": "4.0.8",
|
||||
|
|
@ -25954,8 +25962,7 @@
|
|||
"next-google-fonts": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/next-google-fonts/-/next-google-fonts-1.2.1.tgz",
|
||||
"integrity": "sha512-BhVSldP1oZBTwXeJdMtjmu2qbDT1EkbQO2rG83Oj6APYm6aUsIcMu00Pzkzd8TTkrQW9HyC08Pzr10PY4pE6jA==",
|
||||
"requires": {}
|
||||
"integrity": "sha512-BhVSldP1oZBTwXeJdMtjmu2qbDT1EkbQO2rG83Oj6APYm6aUsIcMu00Pzkzd8TTkrQW9HyC08Pzr10PY4pE6jA=="
|
||||
},
|
||||
"next-images": {
|
||||
"version": "1.6.2",
|
||||
|
|
@ -25972,15 +25979,23 @@
|
|||
"integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw="
|
||||
},
|
||||
"nexus-plugin-prisma": {
|
||||
"version": "0.23.0",
|
||||
"resolved": "https://registry.npmjs.org/nexus-plugin-prisma/-/nexus-plugin-prisma-0.23.0.tgz",
|
||||
"integrity": "sha512-RHdEqEyPCI5g9Evzg/dMm45joVHkk1TPNobDZY20SA1PgU41qmMzYqOZammhiIYaJuYkdt0JxUCS73kt3fcDGg==",
|
||||
"version": "0.23.1",
|
||||
"resolved": "https://registry.npmjs.org/nexus-plugin-prisma/-/nexus-plugin-prisma-0.23.1.tgz",
|
||||
"integrity": "sha512-cSH7BBUtxneLhD6BuGoOAG8uwjOExUfBnqA2LnJlkKP9BX4wG59Oe3LaJZfeiYqs0wex7yMeaN+9/uXIdKEJrA==",
|
||||
"requires": {
|
||||
"camelcase": "^6.0.0",
|
||||
"fs-jetpack": "^4.0.0",
|
||||
"lodash": "^4.17.20",
|
||||
"outdent": "^0.7.1",
|
||||
"pluralize": "^8.0.0"
|
||||
"pluralize": "^8.0.0",
|
||||
"semver": "^7.3.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"semver": {
|
||||
"version": "7.3.2",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz",
|
||||
"integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"no-case": {
|
||||
|
|
@ -27148,8 +27163,7 @@
|
|||
"react-hook-form": {
|
||||
"version": "6.9.6",
|
||||
"resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-6.9.6.tgz",
|
||||
"integrity": "sha512-TyLqWHgFS1WLELDuUBvMWLHEzmR7aS7xOY+eOxMtS1w4jFhqF1xmHnMhJsbiFPSgC+OeTJ1Pc0U4K0y6cA7ERA==",
|
||||
"requires": {}
|
||||
"integrity": "sha512-TyLqWHgFS1WLELDuUBvMWLHEzmR7aS7xOY+eOxMtS1w4jFhqF1xmHnMhJsbiFPSgC+OeTJ1Pc0U4K0y6cA7ERA=="
|
||||
},
|
||||
"react-hotkeys-hook": {
|
||||
"version": "2.4.0",
|
||||
|
|
@ -28535,8 +28549,7 @@
|
|||
"stylis-rule-sheet": {
|
||||
"version": "0.0.10",
|
||||
"resolved": "https://registry.npmjs.org/stylis-rule-sheet/-/stylis-rule-sheet-0.0.10.tgz",
|
||||
"integrity": "sha512-nTbZoaqoBnmK+ptANthb10ZRZOGC+EmTLLUxeYIuHNkEKcmKgXX1XWKkUBT2Ac4es3NybooPe0SmvKdhKJZAuw==",
|
||||
"requires": {}
|
||||
"integrity": "sha512-nTbZoaqoBnmK+ptANthb10ZRZOGC+EmTLLUxeYIuHNkEKcmKgXX1XWKkUBT2Ac4es3NybooPe0SmvKdhKJZAuw=="
|
||||
},
|
||||
"subscriptions-transport-ws": {
|
||||
"version": "0.9.18",
|
||||
|
|
@ -29449,8 +29462,7 @@
|
|||
"use-callback-ref": {
|
||||
"version": "1.2.4",
|
||||
"resolved": "https://registry.npmjs.org/use-callback-ref/-/use-callback-ref-1.2.4.tgz",
|
||||
"integrity": "sha512-rXpsyvOnqdScyied4Uglsp14qzag1JIemLeTWGKbwpotWht57hbP78aNT+Q4wdFKQfQibbUX4fb6Qb4y11aVOQ==",
|
||||
"requires": {}
|
||||
"integrity": "sha512-rXpsyvOnqdScyied4Uglsp14qzag1JIemLeTWGKbwpotWht57hbP78aNT+Q4wdFKQfQibbUX4fb6Qb4y11aVOQ=="
|
||||
},
|
||||
"use-sidecar": {
|
||||
"version": "1.0.3",
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@
|
|||
"migrate:up": "npx prisma migrate up --experimental",
|
||||
"studio": "npx prisma studio",
|
||||
"gen:prisma": "npx prisma generate",
|
||||
"gen:nexus": "ts-node --transpile-only -P nexus.tsconfig.json pages/api",
|
||||
"gen": "graphql-codegen --config codegen.yml",
|
||||
"seed": "ts-node prisma/seed.ts",
|
||||
"prettier": "prettier --write .",
|
||||
|
|
@ -22,7 +21,7 @@
|
|||
"@chakra-ui/theme-tools": "^1.0.0-rc.7",
|
||||
"@hookform/resolvers": "^1.0.0",
|
||||
"@nexus/schema": "^0.17.0",
|
||||
"@prisma/client": "^2.10.0",
|
||||
"@prisma/client": "^2.10.1",
|
||||
"@sendou/react-sketch": "^0.5.2",
|
||||
"apollo-server-micro": "^2.18.2",
|
||||
"countries-list": "^2.5.6",
|
||||
|
|
@ -32,7 +31,7 @@
|
|||
"next-auth": "^3.1.0",
|
||||
"next-google-fonts": "^1.2.1",
|
||||
"next-images": "^1.6.2",
|
||||
"nexus-plugin-prisma": "^0.23.0",
|
||||
"nexus-plugin-prisma": "^0.23.1",
|
||||
"react": "^17.0.1",
|
||||
"react-dom": "^17.0.1",
|
||||
"react-draggable": "^4.4.3",
|
||||
|
|
@ -48,7 +47,7 @@
|
|||
"@graphql-codegen/typescript": "1.17.11",
|
||||
"@graphql-codegen/typescript-operations": "1.17.8",
|
||||
"@graphql-codegen/typescript-react-apollo": "2.0.7",
|
||||
"@prisma/cli": "^2.10.0",
|
||||
"@prisma/cli": "^2.10.1",
|
||||
"@types/next-auth": "^3.1.14",
|
||||
"@types/node": "^14.14.6",
|
||||
"@types/react": "^16.9.55",
|
||||
|
|
|
|||
|
|
@ -6,6 +6,23 @@ type Mutation {
|
|||
updateUserProfile(profile: UpdateUserProfileInput!): Boolean!
|
||||
}
|
||||
|
||||
type Player {
|
||||
"""
|
||||
Set of names player has had in Top 500 results. The most recent one is the first one of the list.
|
||||
"""
|
||||
names: [String!]!
|
||||
placements(after: XRankPlacementWhereUniqueInput, before: XRankPlacementWhereUniqueInput, first: Int, last: Int): [XRankPlacement!]!
|
||||
playerId: String!
|
||||
user: User
|
||||
}
|
||||
|
||||
input PlayerIdModeMonthYearCompoundUniqueInput {
|
||||
mode: RankedMode!
|
||||
month: Int!
|
||||
playerId: String!
|
||||
year: Int!
|
||||
}
|
||||
|
||||
type Profile {
|
||||
bio: String
|
||||
country: String
|
||||
|
|
@ -20,6 +37,25 @@ type Profile {
|
|||
|
||||
type Query {
|
||||
getUserByIdentifier(identifier: String!): User
|
||||
xRankPlacements(after: XRankPlacementWhereUniqueInput, before: XRankPlacementWhereUniqueInput, first: Int, last: Int, orderBy: [QueryXRankPlacementsOrderByInput!]): [XRankPlacement!]!
|
||||
}
|
||||
|
||||
input QueryXRankPlacementsOrderByInput {
|
||||
month: SortOrder
|
||||
ranking: SortOrder
|
||||
year: SortOrder
|
||||
}
|
||||
|
||||
enum RankedMode {
|
||||
CB
|
||||
RM
|
||||
SZ
|
||||
TC
|
||||
}
|
||||
|
||||
enum SortOrder {
|
||||
asc
|
||||
desc
|
||||
}
|
||||
|
||||
input UpdateUserProfileInput {
|
||||
|
|
@ -42,3 +78,21 @@ type User {
|
|||
profile: Profile
|
||||
profilePath: String!
|
||||
}
|
||||
|
||||
type XRankPlacement {
|
||||
id: Int!
|
||||
mode: RankedMode!
|
||||
month: Int!
|
||||
player: Player!
|
||||
playerId: String!
|
||||
playerName: String!
|
||||
ranking: Int!
|
||||
weapon: String!
|
||||
xPower: Float!
|
||||
year: Int!
|
||||
}
|
||||
|
||||
input XRankPlacementWhereUniqueInput {
|
||||
id: Int
|
||||
playerId_mode_month_year: PlayerIdModeMonthYearCompoundUniqueInput
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user