fix merge confilicts with tournaments

This commit is contained in:
MTG2000
2022-09-01 10:07:51 +03:00
parent 5aeadd82ca
commit 2dc324d94c
5 changed files with 159 additions and 219 deletions

View File

@@ -24,7 +24,7 @@ declare global {
declare global {
interface NexusGen extends NexusGenTypes { }
interface NexusGen extends NexusGenTypes {}
}
export interface NexusGenInputs {

View File

@@ -1,6 +1,7 @@
### This file was generated by Nexus Schema
### Do not make changes to this file directly
type Author {
avatar: String!
id: Int!
@@ -75,9 +76,7 @@ type Category {
votes_sum: Int!
}
"""
Date custom scalar type
"""
"""Date custom scalar type"""
scalar Date
type Donation {
@@ -264,11 +263,7 @@ type Query {
officialTags: [Tag!]!
popularTags: [Tag!]!
profile(id: Int!): User
projectsByCategory(
category_id: Int!
skip: Int = 0
take: Int = 10
): [Project!]!
projectsByCategory(category_id: Int!, skip: Int = 0, take: Int = 10): [Project!]!
searchProjects(search: String!, skip: Int = 0, take: Int = 50): [Project!]!
similarMakers(id: Int!): [User!]!
}
@@ -426,4 +421,4 @@ type Vote {
type WalletKey {
key: String!
name: String!
}
}

View File

@@ -1,55 +0,0 @@
const {
intArg,
objectType,
stringArg,
extendType,
nonNull,
} = require('nexus');
const { prisma } = require('../../../prisma');
const Tournament = objectType({
name: 'Tournament',
definition(t) {
t.nonNull.int('id');
t.nonNull.string('title');
t.nonNull.string('description');
t.nonNull.string('thumbnail_image');
t.nonNull.string('cover_image');
t.nonNull.date('start_date');
t.nonNull.date('end_date');
t.nonNull.string('website');
t.nonNull.list.nonNull.field('tags', {
type: "Tag",
resolve: (parent) => {
// return prisma.hackathon.findUnique({ where: { id: parent.id } }).tags();
return [];
}
});
}
})
const getAllTournaments = extendType({
type: "Query",
definition(t) {
t.nonNull.list.nonNull.field('getAllTournaments', {
type: Tournament,
args: {
sortBy: stringArg(),
tag: intArg(),
},
resolve(_, args) {
const { sortBy, tag } = args;
return [];
}
})
}
})
module.exports = {
// Types
Tournament,
// Queries
getAllTournaments,
}

View File

@@ -3,7 +3,7 @@ const { prisma } = require('../../../prisma');
const { objectType, extendType, intArg, nonNull, inputObjectType, interfaceType, list, enumType } = require("nexus");
const { getUserByPubKey } = require("../../../auth/utils/helperFuncs");
const { removeNulls } = require("./helpers");
const { Tournament } = require('./tournaments');
const { Tournament } = require('./tournament');