Some refactoring. dev script, graphql dir.
This commit is contained in:
35
backend/graphql/graphql.typings.ts
Normal file
35
backend/graphql/graphql.typings.ts
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
|
||||||
|
/*
|
||||||
|
* -------------------------------------------------------
|
||||||
|
* THIS FILE WAS AUTOMATICALLY GENERATED (DO NOT MODIFY)
|
||||||
|
* -------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
|
||||||
|
export class CreateUserInput {
|
||||||
|
email: string;
|
||||||
|
password: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class User {
|
||||||
|
id: string;
|
||||||
|
email: string;
|
||||||
|
time_joined: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export abstract class IQuery {
|
||||||
|
abstract users(): Nullable<User>[] | Promise<Nullable<User>[]>;
|
||||||
|
|
||||||
|
abstract user(id: string): Nullable<User> | Promise<Nullable<User>>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export abstract class IMutation {
|
||||||
|
abstract createUser(createUserInput: CreateUserInput): User | Promise<User>;
|
||||||
|
|
||||||
|
abstract removeUser(id: string): Nullable<User> | Promise<Nullable<User>>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type DateTime = any;
|
||||||
|
type Nullable<T> = T | null;
|
||||||
@@ -18,10 +18,9 @@
|
|||||||
"test:cov": "jest --coverage",
|
"test:cov": "jest --coverage",
|
||||||
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
|
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
|
||||||
"test:e2e": "jest --config ./test/jest-e2e.json",
|
"test:e2e": "jest --config ./test/jest-e2e.json",
|
||||||
"generate": "ts-node ./src/graphql/generate.typings",
|
"gen:types": "ts-node ./graphql/generate.typings",
|
||||||
"gen:typings": "ts-node ./src/graphql/generate.typings",
|
"prisma:gen": "prisma generate --watch",
|
||||||
"prisma:generate": "prisma generate --watch",
|
"dev": "concurrently \"yarn:start:dev\" \"yarn:gen:types\" \"yarn:prisma:gen\""
|
||||||
"dev": "concurrently \" yarn start:dev\" \"yarn gen:typings\" \"yarn prisma:generate\""
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nestjs/apollo": "^10.1.0",
|
"@nestjs/apollo": "^10.1.0",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Resolver, Query, Mutation, Args } from '@nestjs/graphql';
|
import { Resolver, Query, Mutation, Args } from '@nestjs/graphql';
|
||||||
import { CreateUserInput } from 'src/graphql/graphql.typings';
|
import { CreateUserInput } from 'graphql/graphql.typings';
|
||||||
import { UsersService } from './users.service';
|
import { UsersService } from './users.service';
|
||||||
|
|
||||||
@Resolver('User')
|
@Resolver('User')
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { CreateUserInput } from 'src/graphql/graphql.typings';
|
import { CreateUserInput } from 'graphql/graphql.typings';
|
||||||
import { Prisma, User } from '@prisma/client';
|
import { Prisma, User } from '@prisma/client';
|
||||||
import { PrismaService } from 'prisma/prisma.service';
|
import { PrismaService } from 'prisma/prisma.service';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user