Remove hasura and hasura-auth (#134)

* Remove hasura and hasura-auth

* Move all models to prisma

* Start implementing graphql

* chore: clean package json

* chore: make the code build

* chore: get initial graphql.tsx file

* feature: use typegql as qgl server

* refactor: small refactoring

* refactor: clean tests

* bugfix: make all filters not case sensitive

* chore: remove unused imports

---------

Co-authored-by: Sammy Teillet <sammy.teillet@gmail.com>
This commit is contained in:
Charles Bochet
2023-05-24 17:20:15 +02:00
committed by GitHub
parent 7192457d0a
commit 5d06398d2e
177 changed files with 12215 additions and 7040 deletions

View File

@ -0,0 +1,10 @@
import { Module } from '@nestjs/common';
import { UserRepository } from './user.repository';
import { PrismaModule } from 'src/database/prisma.module';
@Module({
imports: [PrismaModule],
providers: [UserRepository],
exports: [UserRepository]
})
export class UserModule {}

View File

@ -0,0 +1,19 @@
import { Injectable } from '@nestjs/common';
import { User, Prisma } from '@prisma/client';
import { PrismaService } from 'src/database/prisma.service';
@Injectable()
export class UserRepository {
constructor(private prisma: PrismaService) {}
async findMany(params: {
skip?: number;
take?: number;
cursor?: Prisma.UserWhereUniqueInput;
where?: Prisma.UserWhereInput;
orderBy?: Prisma.UserOrderByWithRelationInput;
}): Promise<User[]> {
const { skip, take, cursor, where, orderBy } = params;
return this.prisma.user.findMany({ skip, take, cursor, where, orderBy });
}
}