Some refactoring. dev script, graphql dir.

This commit is contained in:
2022-09-08 19:21:20 +02:00
parent 1bcf265aec
commit 31e7aec64d
5 changed files with 40 additions and 6 deletions

View 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;

View File

@@ -18,10 +18,9 @@
"test:cov": "jest --coverage",
"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",
"generate": "ts-node ./src/graphql/generate.typings",
"gen:typings": "ts-node ./src/graphql/generate.typings",
"prisma:generate": "prisma generate --watch",
"dev": "concurrently \" yarn start:dev\" \"yarn gen:typings\" \"yarn prisma:generate\""
"gen:types": "ts-node ./graphql/generate.typings",
"prisma:gen": "prisma generate --watch",
"dev": "concurrently \"yarn:start:dev\" \"yarn:gen:types\" \"yarn:prisma:gen\""
},
"dependencies": {
"@nestjs/apollo": "^10.1.0",

View File

@@ -1,5 +1,5 @@
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';
@Resolver('User')

View File

@@ -1,5 +1,5 @@
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 { PrismaService } from 'prisma/prisma.service';