Sammy/t 245 implement resolvers matching hasura (#139)
* chore: remove old resolvers * refactor: move generated file in code base * feature: use only necessary code in graphql * feature: implement query companies * feature: implement companies and relations * feature: implement all companies resolvers * feature: implement all people resolver * feature: add use resolvers * feature: implement resolvers for workspace and users
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@ -7,7 +7,7 @@ export const GET_CURRENT_USER = gql`
|
|||||||
id
|
id
|
||||||
email
|
email
|
||||||
displayName
|
displayName
|
||||||
workspace_member: workspaceMember {
|
workspace_member: WorkspaceMember {
|
||||||
workspace {
|
workspace {
|
||||||
id
|
id
|
||||||
domain_name: domainName
|
domain_name: domainName
|
||||||
|
|||||||
@ -1,44 +1,30 @@
|
|||||||
import { Module } from '@nestjs/common';
|
import { Module } from '@nestjs/common';
|
||||||
import { TypeGraphQLModule } from 'typegraphql-nestjs';
|
import { GraphQLModule } from '@nestjs/graphql';
|
||||||
import { ApolloDriver } from '@nestjs/apollo';
|
import { ApolloDriver, ApolloDriverConfig } from '@nestjs/apollo';
|
||||||
|
import { CompanyResolvers } from './company.resolvers';
|
||||||
import { PrismaClient } from '@prisma/client';
|
import { PrismaClient } from '@prisma/client';
|
||||||
|
import { CompanyRelationsResolver } from './local-graphql';
|
||||||
import {
|
import { PeopleResolvers } from './people.resolver';
|
||||||
CompanyCrudResolver,
|
import { PersonRelationsResolver } from './people-relations.resolver';
|
||||||
CompanyRelationsResolver,
|
import { UserResolvers } from './user.resolver';
|
||||||
UserCrudResolver,
|
import { UserRelationsResolver } from './user-relations.resolver';
|
||||||
UserRelationsResolver,
|
import { WorkspaceMemberRelationsResolver } from './workspace-member-relations.resolver';
|
||||||
PersonCrudResolver,
|
|
||||||
PersonRelationsResolver,
|
|
||||||
WorkspaceCrudResolver,
|
|
||||||
WorkspaceRelationsResolver,
|
|
||||||
WorkspaceMemberRelationsResolver,
|
|
||||||
} from '@generated/type-graphql';
|
|
||||||
|
|
||||||
interface Context {
|
|
||||||
prisma: PrismaClient;
|
|
||||||
}
|
|
||||||
|
|
||||||
const prisma = new PrismaClient();
|
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
imports: [
|
imports: [
|
||||||
TypeGraphQLModule.forRoot({
|
GraphQLModule.forRoot<ApolloDriverConfig>({
|
||||||
driver: ApolloDriver,
|
driver: ApolloDriver,
|
||||||
path: '/',
|
autoSchemaFile: true,
|
||||||
validate: false,
|
|
||||||
context: (): Context => ({ prisma }),
|
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
CompanyCrudResolver,
|
PrismaClient,
|
||||||
|
CompanyResolvers,
|
||||||
CompanyRelationsResolver,
|
CompanyRelationsResolver,
|
||||||
UserCrudResolver,
|
PeopleResolvers,
|
||||||
UserRelationsResolver,
|
|
||||||
PersonCrudResolver,
|
|
||||||
PersonRelationsResolver,
|
PersonRelationsResolver,
|
||||||
WorkspaceCrudResolver,
|
UserResolvers,
|
||||||
WorkspaceRelationsResolver,
|
UserRelationsResolver,
|
||||||
WorkspaceMemberRelationsResolver,
|
WorkspaceMemberRelationsResolver,
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
|
|||||||
59
server/src/api/company-relations.resolver.ts
Normal file
59
server/src/api/company-relations.resolver.ts
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
import type { GraphQLResolveInfo } from 'graphql';
|
||||||
|
import { Company } from './local-graphql/models/Company';
|
||||||
|
import { Person } from './local-graphql/models/Person';
|
||||||
|
import { User } from './local-graphql/models/User';
|
||||||
|
import { Workspace } from './local-graphql/models/Workspace';
|
||||||
|
import { PrismaClient } from '@prisma/client';
|
||||||
|
import { CompanyPeopleArgs } from './local-graphql/resolvers/relations/Company/args/CompanyPeopleArgs';
|
||||||
|
|
||||||
|
@TypeGraphQL.Resolver(() => Company)
|
||||||
|
export class CompanyRelationsResolver {
|
||||||
|
constructor(private readonly prismaClient: PrismaClient) {}
|
||||||
|
|
||||||
|
@TypeGraphQL.ResolveField(() => User, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
async accountOwner(
|
||||||
|
@TypeGraphQL.Parent() company: Company,
|
||||||
|
): Promise<User | null> {
|
||||||
|
return this.prismaClient.company
|
||||||
|
.findUniqueOrThrow({
|
||||||
|
where: {
|
||||||
|
id: company.id,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.accountOwner({});
|
||||||
|
}
|
||||||
|
|
||||||
|
@TypeGraphQL.ResolveField(() => [Person], {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
async people(
|
||||||
|
@TypeGraphQL.Root() company: Company,
|
||||||
|
@TypeGraphQL.Args() args: CompanyPeopleArgs,
|
||||||
|
): Promise<Person[]> {
|
||||||
|
return this.prismaClient.company
|
||||||
|
.findUniqueOrThrow({
|
||||||
|
where: {
|
||||||
|
id: company.id,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.people({
|
||||||
|
...args,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@TypeGraphQL.ResolveField(() => Workspace, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
async workspace(@TypeGraphQL.Root() company: Company): Promise<Workspace> {
|
||||||
|
return this.prismaClient.company
|
||||||
|
.findUniqueOrThrow({
|
||||||
|
where: {
|
||||||
|
id: company.id,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.workspace({});
|
||||||
|
}
|
||||||
|
}
|
||||||
57
server/src/api/company.resolvers.ts
Normal file
57
server/src/api/company.resolvers.ts
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
import { PrismaClient } from '@prisma/client';
|
||||||
|
import { Company } from './local-graphql/models';
|
||||||
|
import { Resolver, Query, Args, Mutation } from '@nestjs/graphql';
|
||||||
|
import { FindManyCompanyArgs } from './local-graphql/resolvers/crud/Company/args/FindManyCompanyArgs';
|
||||||
|
import { DeleteOneCompanyArgs } from './local-graphql/resolvers/crud/Company/args/DeleteOneCompanyArgs';
|
||||||
|
import { UpdateOneCompanyArgs } from './local-graphql/resolvers/crud/Company/args/UpdateOneCompanyArgs';
|
||||||
|
import { CreateOneCompanyArgs } from './local-graphql/resolvers/crud/Company/args/CreateOneCompanyArgs';
|
||||||
|
import { AffectedRowsOutput, DeleteManyCompanyArgs } from './local-graphql';
|
||||||
|
|
||||||
|
@Resolver(() => Company)
|
||||||
|
export class CompanyResolvers {
|
||||||
|
constructor(private readonly prismaClient: PrismaClient) {}
|
||||||
|
@Query(() => [Company])
|
||||||
|
async companies(@Args() args: FindManyCompanyArgs) {
|
||||||
|
return this.prismaClient.company.findMany(args);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Mutation(() => Company, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
async deleteOneCompany(
|
||||||
|
@Args() args: DeleteOneCompanyArgs,
|
||||||
|
): Promise<Company | null> {
|
||||||
|
return this.prismaClient.company.delete(args);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Mutation(() => Company, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
async updateOneCompany(
|
||||||
|
@Args() args: UpdateOneCompanyArgs,
|
||||||
|
): Promise<Company | null> {
|
||||||
|
return this.prismaClient.company.update({
|
||||||
|
...args,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Mutation(() => Company, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
async createOneCompany(@Args() args: CreateOneCompanyArgs): Promise<Company> {
|
||||||
|
return this.prismaClient.company.create({
|
||||||
|
...args,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Mutation(() => AffectedRowsOutput, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
async deleteManyCompany(
|
||||||
|
@Args() args: DeleteManyCompanyArgs,
|
||||||
|
): Promise<AffectedRowsOutput> {
|
||||||
|
return this.prismaClient.company.deleteMany({
|
||||||
|
...args,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,18 +0,0 @@
|
|||||||
import { GraphQLScalarType } from 'graphql';
|
|
||||||
|
|
||||||
const regex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
||||||
|
|
||||||
function validate(uuid: unknown): string | never {
|
|
||||||
if (typeof uuid !== 'string' || !regex.test(uuid)) {
|
|
||||||
throw new Error('invalid uuid');
|
|
||||||
}
|
|
||||||
return uuid;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const CustomUuidScalar = new GraphQLScalarType({
|
|
||||||
name: 'uuid',
|
|
||||||
description: 'A simple UUID parser',
|
|
||||||
serialize: (value) => validate(value),
|
|
||||||
parseValue: (value) => validate(value),
|
|
||||||
parseLiteral: (ast) => validate(ast.kind === 'StringValue' ? ast.value : ''),
|
|
||||||
});
|
|
||||||
795
server/src/api/local-graphql/enhance.ts
Normal file
795
server/src/api/local-graphql/enhance.ts
Normal file
@ -0,0 +1,795 @@
|
|||||||
|
import { ClassType } from "type-graphql";
|
||||||
|
import * as tslib from "tslib";
|
||||||
|
import * as crudResolvers from "./resolvers/crud/resolvers-crud.index";
|
||||||
|
import * as argsTypes from "./resolvers/crud/args.index";
|
||||||
|
import * as actionResolvers from "./resolvers/crud/resolvers-actions.index";
|
||||||
|
import * as relationResolvers from "./resolvers/relations/resolvers.index";
|
||||||
|
import * as models from "./models";
|
||||||
|
import * as outputTypes from "./resolvers/outputs";
|
||||||
|
import * as inputTypes from "./resolvers/inputs";
|
||||||
|
|
||||||
|
export type MethodDecoratorOverrideFn = (decorators: MethodDecorator[]) => MethodDecorator[];
|
||||||
|
|
||||||
|
const crudResolversMap = {
|
||||||
|
User: crudResolvers.UserCrudResolver,
|
||||||
|
Workspace: crudResolvers.WorkspaceCrudResolver,
|
||||||
|
WorkspaceMember: crudResolvers.WorkspaceMemberCrudResolver,
|
||||||
|
Company: crudResolvers.CompanyCrudResolver,
|
||||||
|
Person: crudResolvers.PersonCrudResolver,
|
||||||
|
RefreshToken: crudResolvers.RefreshTokenCrudResolver
|
||||||
|
};
|
||||||
|
const actionResolversMap = {
|
||||||
|
User: {
|
||||||
|
aggregateUser: actionResolvers.AggregateUserResolver,
|
||||||
|
createManyUser: actionResolvers.CreateManyUserResolver,
|
||||||
|
createOneUser: actionResolvers.CreateOneUserResolver,
|
||||||
|
deleteManyUser: actionResolvers.DeleteManyUserResolver,
|
||||||
|
deleteOneUser: actionResolvers.DeleteOneUserResolver,
|
||||||
|
findFirstUser: actionResolvers.FindFirstUserResolver,
|
||||||
|
findFirstUserOrThrow: actionResolvers.FindFirstUserOrThrowResolver,
|
||||||
|
users: actionResolvers.FindManyUserResolver,
|
||||||
|
user: actionResolvers.FindUniqueUserResolver,
|
||||||
|
getUser: actionResolvers.FindUniqueUserOrThrowResolver,
|
||||||
|
groupByUser: actionResolvers.GroupByUserResolver,
|
||||||
|
updateManyUser: actionResolvers.UpdateManyUserResolver,
|
||||||
|
updateOneUser: actionResolvers.UpdateOneUserResolver,
|
||||||
|
upsertOneUser: actionResolvers.UpsertOneUserResolver
|
||||||
|
},
|
||||||
|
Workspace: {
|
||||||
|
aggregateWorkspace: actionResolvers.AggregateWorkspaceResolver,
|
||||||
|
createManyWorkspace: actionResolvers.CreateManyWorkspaceResolver,
|
||||||
|
createOneWorkspace: actionResolvers.CreateOneWorkspaceResolver,
|
||||||
|
deleteManyWorkspace: actionResolvers.DeleteManyWorkspaceResolver,
|
||||||
|
deleteOneWorkspace: actionResolvers.DeleteOneWorkspaceResolver,
|
||||||
|
findFirstWorkspace: actionResolvers.FindFirstWorkspaceResolver,
|
||||||
|
findFirstWorkspaceOrThrow: actionResolvers.FindFirstWorkspaceOrThrowResolver,
|
||||||
|
workspaces: actionResolvers.FindManyWorkspaceResolver,
|
||||||
|
workspace: actionResolvers.FindUniqueWorkspaceResolver,
|
||||||
|
getWorkspace: actionResolvers.FindUniqueWorkspaceOrThrowResolver,
|
||||||
|
groupByWorkspace: actionResolvers.GroupByWorkspaceResolver,
|
||||||
|
updateManyWorkspace: actionResolvers.UpdateManyWorkspaceResolver,
|
||||||
|
updateOneWorkspace: actionResolvers.UpdateOneWorkspaceResolver,
|
||||||
|
upsertOneWorkspace: actionResolvers.UpsertOneWorkspaceResolver
|
||||||
|
},
|
||||||
|
WorkspaceMember: {
|
||||||
|
aggregateWorkspaceMember: actionResolvers.AggregateWorkspaceMemberResolver,
|
||||||
|
createManyWorkspaceMember: actionResolvers.CreateManyWorkspaceMemberResolver,
|
||||||
|
createOneWorkspaceMember: actionResolvers.CreateOneWorkspaceMemberResolver,
|
||||||
|
deleteManyWorkspaceMember: actionResolvers.DeleteManyWorkspaceMemberResolver,
|
||||||
|
deleteOneWorkspaceMember: actionResolvers.DeleteOneWorkspaceMemberResolver,
|
||||||
|
findFirstWorkspaceMember: actionResolvers.FindFirstWorkspaceMemberResolver,
|
||||||
|
findFirstWorkspaceMemberOrThrow: actionResolvers.FindFirstWorkspaceMemberOrThrowResolver,
|
||||||
|
workspaceMembers: actionResolvers.FindManyWorkspaceMemberResolver,
|
||||||
|
workspaceMember: actionResolvers.FindUniqueWorkspaceMemberResolver,
|
||||||
|
getWorkspaceMember: actionResolvers.FindUniqueWorkspaceMemberOrThrowResolver,
|
||||||
|
groupByWorkspaceMember: actionResolvers.GroupByWorkspaceMemberResolver,
|
||||||
|
updateManyWorkspaceMember: actionResolvers.UpdateManyWorkspaceMemberResolver,
|
||||||
|
updateOneWorkspaceMember: actionResolvers.UpdateOneWorkspaceMemberResolver,
|
||||||
|
upsertOneWorkspaceMember: actionResolvers.UpsertOneWorkspaceMemberResolver
|
||||||
|
},
|
||||||
|
Company: {
|
||||||
|
aggregateCompany: actionResolvers.AggregateCompanyResolver,
|
||||||
|
createManyCompany: actionResolvers.CreateManyCompanyResolver,
|
||||||
|
createOneCompany: actionResolvers.CreateOneCompanyResolver,
|
||||||
|
deleteManyCompany: actionResolvers.DeleteManyCompanyResolver,
|
||||||
|
deleteOneCompany: actionResolvers.DeleteOneCompanyResolver,
|
||||||
|
findFirstCompany: actionResolvers.FindFirstCompanyResolver,
|
||||||
|
findFirstCompanyOrThrow: actionResolvers.FindFirstCompanyOrThrowResolver,
|
||||||
|
companies: actionResolvers.FindManyCompanyResolver,
|
||||||
|
company: actionResolvers.FindUniqueCompanyResolver,
|
||||||
|
getCompany: actionResolvers.FindUniqueCompanyOrThrowResolver,
|
||||||
|
groupByCompany: actionResolvers.GroupByCompanyResolver,
|
||||||
|
updateManyCompany: actionResolvers.UpdateManyCompanyResolver,
|
||||||
|
updateOneCompany: actionResolvers.UpdateOneCompanyResolver,
|
||||||
|
upsertOneCompany: actionResolvers.UpsertOneCompanyResolver
|
||||||
|
},
|
||||||
|
Person: {
|
||||||
|
aggregatePerson: actionResolvers.AggregatePersonResolver,
|
||||||
|
createManyPerson: actionResolvers.CreateManyPersonResolver,
|
||||||
|
createOnePerson: actionResolvers.CreateOnePersonResolver,
|
||||||
|
deleteManyPerson: actionResolvers.DeleteManyPersonResolver,
|
||||||
|
deleteOnePerson: actionResolvers.DeleteOnePersonResolver,
|
||||||
|
findFirstPerson: actionResolvers.FindFirstPersonResolver,
|
||||||
|
findFirstPersonOrThrow: actionResolvers.FindFirstPersonOrThrowResolver,
|
||||||
|
people: actionResolvers.FindManyPersonResolver,
|
||||||
|
person: actionResolvers.FindUniquePersonResolver,
|
||||||
|
getPerson: actionResolvers.FindUniquePersonOrThrowResolver,
|
||||||
|
groupByPerson: actionResolvers.GroupByPersonResolver,
|
||||||
|
updateManyPerson: actionResolvers.UpdateManyPersonResolver,
|
||||||
|
updateOnePerson: actionResolvers.UpdateOnePersonResolver,
|
||||||
|
upsertOnePerson: actionResolvers.UpsertOnePersonResolver
|
||||||
|
},
|
||||||
|
RefreshToken: {
|
||||||
|
aggregateRefreshToken: actionResolvers.AggregateRefreshTokenResolver,
|
||||||
|
createManyRefreshToken: actionResolvers.CreateManyRefreshTokenResolver,
|
||||||
|
createOneRefreshToken: actionResolvers.CreateOneRefreshTokenResolver,
|
||||||
|
deleteManyRefreshToken: actionResolvers.DeleteManyRefreshTokenResolver,
|
||||||
|
deleteOneRefreshToken: actionResolvers.DeleteOneRefreshTokenResolver,
|
||||||
|
findFirstRefreshToken: actionResolvers.FindFirstRefreshTokenResolver,
|
||||||
|
findFirstRefreshTokenOrThrow: actionResolvers.FindFirstRefreshTokenOrThrowResolver,
|
||||||
|
refreshTokens: actionResolvers.FindManyRefreshTokenResolver,
|
||||||
|
refreshToken: actionResolvers.FindUniqueRefreshTokenResolver,
|
||||||
|
getRefreshToken: actionResolvers.FindUniqueRefreshTokenOrThrowResolver,
|
||||||
|
groupByRefreshToken: actionResolvers.GroupByRefreshTokenResolver,
|
||||||
|
updateManyRefreshToken: actionResolvers.UpdateManyRefreshTokenResolver,
|
||||||
|
updateOneRefreshToken: actionResolvers.UpdateOneRefreshTokenResolver,
|
||||||
|
upsertOneRefreshToken: actionResolvers.UpsertOneRefreshTokenResolver
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const crudResolversInfo = {
|
||||||
|
User: ["aggregateUser", "createManyUser", "createOneUser", "deleteManyUser", "deleteOneUser", "findFirstUser", "findFirstUserOrThrow", "users", "user", "getUser", "groupByUser", "updateManyUser", "updateOneUser", "upsertOneUser"],
|
||||||
|
Workspace: ["aggregateWorkspace", "createManyWorkspace", "createOneWorkspace", "deleteManyWorkspace", "deleteOneWorkspace", "findFirstWorkspace", "findFirstWorkspaceOrThrow", "workspaces", "workspace", "getWorkspace", "groupByWorkspace", "updateManyWorkspace", "updateOneWorkspace", "upsertOneWorkspace"],
|
||||||
|
WorkspaceMember: ["aggregateWorkspaceMember", "createManyWorkspaceMember", "createOneWorkspaceMember", "deleteManyWorkspaceMember", "deleteOneWorkspaceMember", "findFirstWorkspaceMember", "findFirstWorkspaceMemberOrThrow", "workspaceMembers", "workspaceMember", "getWorkspaceMember", "groupByWorkspaceMember", "updateManyWorkspaceMember", "updateOneWorkspaceMember", "upsertOneWorkspaceMember"],
|
||||||
|
Company: ["aggregateCompany", "createManyCompany", "createOneCompany", "deleteManyCompany", "deleteOneCompany", "findFirstCompany", "findFirstCompanyOrThrow", "companies", "company", "getCompany", "groupByCompany", "updateManyCompany", "updateOneCompany", "upsertOneCompany"],
|
||||||
|
Person: ["aggregatePerson", "createManyPerson", "createOnePerson", "deleteManyPerson", "deleteOnePerson", "findFirstPerson", "findFirstPersonOrThrow", "people", "person", "getPerson", "groupByPerson", "updateManyPerson", "updateOnePerson", "upsertOnePerson"],
|
||||||
|
RefreshToken: ["aggregateRefreshToken", "createManyRefreshToken", "createOneRefreshToken", "deleteManyRefreshToken", "deleteOneRefreshToken", "findFirstRefreshToken", "findFirstRefreshTokenOrThrow", "refreshTokens", "refreshToken", "getRefreshToken", "groupByRefreshToken", "updateManyRefreshToken", "updateOneRefreshToken", "upsertOneRefreshToken"]
|
||||||
|
};
|
||||||
|
const argsInfo = {
|
||||||
|
AggregateUserArgs: ["where", "orderBy", "cursor", "take", "skip"],
|
||||||
|
CreateManyUserArgs: ["data", "skipDuplicates"],
|
||||||
|
CreateOneUserArgs: ["data"],
|
||||||
|
DeleteManyUserArgs: ["where"],
|
||||||
|
DeleteOneUserArgs: ["where"],
|
||||||
|
FindFirstUserArgs: ["where", "orderBy", "cursor", "take", "skip", "distinct"],
|
||||||
|
FindFirstUserOrThrowArgs: ["where", "orderBy", "cursor", "take", "skip", "distinct"],
|
||||||
|
FindManyUserArgs: ["where", "orderBy", "cursor", "take", "skip", "distinct"],
|
||||||
|
FindUniqueUserArgs: ["where"],
|
||||||
|
FindUniqueUserOrThrowArgs: ["where"],
|
||||||
|
GroupByUserArgs: ["where", "orderBy", "by", "having", "take", "skip"],
|
||||||
|
UpdateManyUserArgs: ["data", "where"],
|
||||||
|
UpdateOneUserArgs: ["data", "where"],
|
||||||
|
UpsertOneUserArgs: ["where", "create", "update"],
|
||||||
|
AggregateWorkspaceArgs: ["where", "orderBy", "cursor", "take", "skip"],
|
||||||
|
CreateManyWorkspaceArgs: ["data", "skipDuplicates"],
|
||||||
|
CreateOneWorkspaceArgs: ["data"],
|
||||||
|
DeleteManyWorkspaceArgs: ["where"],
|
||||||
|
DeleteOneWorkspaceArgs: ["where"],
|
||||||
|
FindFirstWorkspaceArgs: ["where", "orderBy", "cursor", "take", "skip", "distinct"],
|
||||||
|
FindFirstWorkspaceOrThrowArgs: ["where", "orderBy", "cursor", "take", "skip", "distinct"],
|
||||||
|
FindManyWorkspaceArgs: ["where", "orderBy", "cursor", "take", "skip", "distinct"],
|
||||||
|
FindUniqueWorkspaceArgs: ["where"],
|
||||||
|
FindUniqueWorkspaceOrThrowArgs: ["where"],
|
||||||
|
GroupByWorkspaceArgs: ["where", "orderBy", "by", "having", "take", "skip"],
|
||||||
|
UpdateManyWorkspaceArgs: ["data", "where"],
|
||||||
|
UpdateOneWorkspaceArgs: ["data", "where"],
|
||||||
|
UpsertOneWorkspaceArgs: ["where", "create", "update"],
|
||||||
|
AggregateWorkspaceMemberArgs: ["where", "orderBy", "cursor", "take", "skip"],
|
||||||
|
CreateManyWorkspaceMemberArgs: ["data", "skipDuplicates"],
|
||||||
|
CreateOneWorkspaceMemberArgs: ["data"],
|
||||||
|
DeleteManyWorkspaceMemberArgs: ["where"],
|
||||||
|
DeleteOneWorkspaceMemberArgs: ["where"],
|
||||||
|
FindFirstWorkspaceMemberArgs: ["where", "orderBy", "cursor", "take", "skip", "distinct"],
|
||||||
|
FindFirstWorkspaceMemberOrThrowArgs: ["where", "orderBy", "cursor", "take", "skip", "distinct"],
|
||||||
|
FindManyWorkspaceMemberArgs: ["where", "orderBy", "cursor", "take", "skip", "distinct"],
|
||||||
|
FindUniqueWorkspaceMemberArgs: ["where"],
|
||||||
|
FindUniqueWorkspaceMemberOrThrowArgs: ["where"],
|
||||||
|
GroupByWorkspaceMemberArgs: ["where", "orderBy", "by", "having", "take", "skip"],
|
||||||
|
UpdateManyWorkspaceMemberArgs: ["data", "where"],
|
||||||
|
UpdateOneWorkspaceMemberArgs: ["data", "where"],
|
||||||
|
UpsertOneWorkspaceMemberArgs: ["where", "create", "update"],
|
||||||
|
AggregateCompanyArgs: ["where", "orderBy", "cursor", "take", "skip"],
|
||||||
|
CreateManyCompanyArgs: ["data", "skipDuplicates"],
|
||||||
|
CreateOneCompanyArgs: ["data"],
|
||||||
|
DeleteManyCompanyArgs: ["where"],
|
||||||
|
DeleteOneCompanyArgs: ["where"],
|
||||||
|
FindFirstCompanyArgs: ["where", "orderBy", "cursor", "take", "skip", "distinct"],
|
||||||
|
FindFirstCompanyOrThrowArgs: ["where", "orderBy", "cursor", "take", "skip", "distinct"],
|
||||||
|
FindManyCompanyArgs: ["where", "orderBy", "cursor", "take", "skip", "distinct"],
|
||||||
|
FindUniqueCompanyArgs: ["where"],
|
||||||
|
FindUniqueCompanyOrThrowArgs: ["where"],
|
||||||
|
GroupByCompanyArgs: ["where", "orderBy", "by", "having", "take", "skip"],
|
||||||
|
UpdateManyCompanyArgs: ["data", "where"],
|
||||||
|
UpdateOneCompanyArgs: ["data", "where"],
|
||||||
|
UpsertOneCompanyArgs: ["where", "create", "update"],
|
||||||
|
AggregatePersonArgs: ["where", "orderBy", "cursor", "take", "skip"],
|
||||||
|
CreateManyPersonArgs: ["data", "skipDuplicates"],
|
||||||
|
CreateOnePersonArgs: ["data"],
|
||||||
|
DeleteManyPersonArgs: ["where"],
|
||||||
|
DeleteOnePersonArgs: ["where"],
|
||||||
|
FindFirstPersonArgs: ["where", "orderBy", "cursor", "take", "skip", "distinct"],
|
||||||
|
FindFirstPersonOrThrowArgs: ["where", "orderBy", "cursor", "take", "skip", "distinct"],
|
||||||
|
FindManyPersonArgs: ["where", "orderBy", "cursor", "take", "skip", "distinct"],
|
||||||
|
FindUniquePersonArgs: ["where"],
|
||||||
|
FindUniquePersonOrThrowArgs: ["where"],
|
||||||
|
GroupByPersonArgs: ["where", "orderBy", "by", "having", "take", "skip"],
|
||||||
|
UpdateManyPersonArgs: ["data", "where"],
|
||||||
|
UpdateOnePersonArgs: ["data", "where"],
|
||||||
|
UpsertOnePersonArgs: ["where", "create", "update"],
|
||||||
|
AggregateRefreshTokenArgs: ["where", "orderBy", "cursor", "take", "skip"],
|
||||||
|
CreateManyRefreshTokenArgs: ["data", "skipDuplicates"],
|
||||||
|
CreateOneRefreshTokenArgs: ["data"],
|
||||||
|
DeleteManyRefreshTokenArgs: ["where"],
|
||||||
|
DeleteOneRefreshTokenArgs: ["where"],
|
||||||
|
FindFirstRefreshTokenArgs: ["where", "orderBy", "cursor", "take", "skip", "distinct"],
|
||||||
|
FindFirstRefreshTokenOrThrowArgs: ["where", "orderBy", "cursor", "take", "skip", "distinct"],
|
||||||
|
FindManyRefreshTokenArgs: ["where", "orderBy", "cursor", "take", "skip", "distinct"],
|
||||||
|
FindUniqueRefreshTokenArgs: ["where"],
|
||||||
|
FindUniqueRefreshTokenOrThrowArgs: ["where"],
|
||||||
|
GroupByRefreshTokenArgs: ["where", "orderBy", "by", "having", "take", "skip"],
|
||||||
|
UpdateManyRefreshTokenArgs: ["data", "where"],
|
||||||
|
UpdateOneRefreshTokenArgs: ["data", "where"],
|
||||||
|
UpsertOneRefreshTokenArgs: ["where", "create", "update"]
|
||||||
|
};
|
||||||
|
|
||||||
|
type ResolverModelNames = keyof typeof crudResolversMap;
|
||||||
|
|
||||||
|
type ModelResolverActionNames<
|
||||||
|
TModel extends ResolverModelNames
|
||||||
|
> = keyof typeof crudResolversMap[TModel]["prototype"];
|
||||||
|
|
||||||
|
export type ResolverActionsConfig<
|
||||||
|
TModel extends ResolverModelNames
|
||||||
|
> = Partial<Record<ModelResolverActionNames<TModel>, MethodDecorator[] | MethodDecoratorOverrideFn>>
|
||||||
|
& {
|
||||||
|
_all?: MethodDecorator[];
|
||||||
|
_query?: MethodDecorator[];
|
||||||
|
_mutation?: MethodDecorator[];
|
||||||
|
};
|
||||||
|
|
||||||
|
export type ResolversEnhanceMap = {
|
||||||
|
[TModel in ResolverModelNames]?: ResolverActionsConfig<TModel>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export function applyResolversEnhanceMap(
|
||||||
|
resolversEnhanceMap: ResolversEnhanceMap,
|
||||||
|
) {
|
||||||
|
const mutationOperationPrefixes = [
|
||||||
|
"createOne", "createMany", "deleteOne", "updateOne", "deleteMany", "updateMany", "upsertOne"
|
||||||
|
];
|
||||||
|
for (const resolversEnhanceMapKey of Object.keys(resolversEnhanceMap)) {
|
||||||
|
const modelName = resolversEnhanceMapKey as keyof typeof resolversEnhanceMap;
|
||||||
|
const crudTarget = crudResolversMap[modelName].prototype;
|
||||||
|
const resolverActionsConfig = resolversEnhanceMap[modelName]!;
|
||||||
|
const actionResolversConfig = actionResolversMap[modelName];
|
||||||
|
const allActionsDecorators = resolverActionsConfig._all;
|
||||||
|
const resolverActionNames = crudResolversInfo[modelName as keyof typeof crudResolversInfo];
|
||||||
|
for (const resolverActionName of resolverActionNames) {
|
||||||
|
const maybeDecoratorsOrFn = resolverActionsConfig[
|
||||||
|
resolverActionName as keyof typeof resolverActionsConfig
|
||||||
|
] as MethodDecorator[] | MethodDecoratorOverrideFn | undefined;
|
||||||
|
const isWriteOperation = mutationOperationPrefixes.some(prefix => resolverActionName.startsWith(prefix));
|
||||||
|
const operationKindDecorators = isWriteOperation ? resolverActionsConfig._mutation : resolverActionsConfig._query;
|
||||||
|
const mainDecorators = [
|
||||||
|
...allActionsDecorators ?? [],
|
||||||
|
...operationKindDecorators ?? [],
|
||||||
|
]
|
||||||
|
let decorators: MethodDecorator[];
|
||||||
|
if (typeof maybeDecoratorsOrFn === "function") {
|
||||||
|
decorators = maybeDecoratorsOrFn(mainDecorators);
|
||||||
|
} else {
|
||||||
|
decorators = [...mainDecorators, ...maybeDecoratorsOrFn ?? []];
|
||||||
|
}
|
||||||
|
const actionTarget = (actionResolversConfig[
|
||||||
|
resolverActionName as keyof typeof actionResolversConfig
|
||||||
|
] as Function).prototype;
|
||||||
|
tslib.__decorate(decorators, crudTarget, resolverActionName, null);
|
||||||
|
tslib.__decorate(decorators, actionTarget, resolverActionName, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
type ArgsTypesNames = keyof typeof argsTypes;
|
||||||
|
|
||||||
|
type ArgFieldNames<TArgsType extends ArgsTypesNames> = Exclude<
|
||||||
|
keyof typeof argsTypes[TArgsType]["prototype"],
|
||||||
|
number | symbol
|
||||||
|
>;
|
||||||
|
|
||||||
|
type ArgFieldsConfig<
|
||||||
|
TArgsType extends ArgsTypesNames
|
||||||
|
> = FieldsConfig<ArgFieldNames<TArgsType>>;
|
||||||
|
|
||||||
|
export type ArgConfig<TArgsType extends ArgsTypesNames> = {
|
||||||
|
class?: ClassDecorator[];
|
||||||
|
fields?: ArgFieldsConfig<TArgsType>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type ArgsTypesEnhanceMap = {
|
||||||
|
[TArgsType in ArgsTypesNames]?: ArgConfig<TArgsType>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export function applyArgsTypesEnhanceMap(
|
||||||
|
argsTypesEnhanceMap: ArgsTypesEnhanceMap,
|
||||||
|
) {
|
||||||
|
for (const argsTypesEnhanceMapKey of Object.keys(argsTypesEnhanceMap)) {
|
||||||
|
const argsTypeName = argsTypesEnhanceMapKey as keyof typeof argsTypesEnhanceMap;
|
||||||
|
const typeConfig = argsTypesEnhanceMap[argsTypeName]!;
|
||||||
|
const typeClass = argsTypes[argsTypeName];
|
||||||
|
const typeTarget = typeClass.prototype;
|
||||||
|
applyTypeClassEnhanceConfig(
|
||||||
|
typeConfig,
|
||||||
|
typeClass,
|
||||||
|
typeTarget,
|
||||||
|
argsInfo[argsTypeName as keyof typeof argsInfo],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const relationResolversMap = {
|
||||||
|
User: relationResolvers.UserRelationsResolver,
|
||||||
|
Workspace: relationResolvers.WorkspaceRelationsResolver,
|
||||||
|
WorkspaceMember: relationResolvers.WorkspaceMemberRelationsResolver,
|
||||||
|
Company: relationResolvers.CompanyRelationsResolver,
|
||||||
|
Person: relationResolvers.PersonRelationsResolver,
|
||||||
|
RefreshToken: relationResolvers.RefreshTokenRelationsResolver
|
||||||
|
};
|
||||||
|
const relationResolversInfo = {
|
||||||
|
User: ["WorkspaceMember", "companies", "RefreshTokens"],
|
||||||
|
Workspace: ["WorkspaceMember", "companies", "people"],
|
||||||
|
WorkspaceMember: ["user", "workspace"],
|
||||||
|
Company: ["accountOwner", "people", "workspace"],
|
||||||
|
Person: ["company", "workspace"],
|
||||||
|
RefreshToken: ["user"]
|
||||||
|
};
|
||||||
|
|
||||||
|
type RelationResolverModelNames = keyof typeof relationResolversMap;
|
||||||
|
|
||||||
|
type RelationResolverActionNames<
|
||||||
|
TModel extends RelationResolverModelNames
|
||||||
|
> = keyof typeof relationResolversMap[TModel]["prototype"];
|
||||||
|
|
||||||
|
export type RelationResolverActionsConfig<TModel extends RelationResolverModelNames>
|
||||||
|
= Partial<Record<RelationResolverActionNames<TModel>, MethodDecorator[] | MethodDecoratorOverrideFn>>
|
||||||
|
& { _all?: MethodDecorator[] };
|
||||||
|
|
||||||
|
export type RelationResolversEnhanceMap = {
|
||||||
|
[TModel in RelationResolverModelNames]?: RelationResolverActionsConfig<TModel>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export function applyRelationResolversEnhanceMap(
|
||||||
|
relationResolversEnhanceMap: RelationResolversEnhanceMap,
|
||||||
|
) {
|
||||||
|
for (const relationResolversEnhanceMapKey of Object.keys(relationResolversEnhanceMap)) {
|
||||||
|
const modelName = relationResolversEnhanceMapKey as keyof typeof relationResolversEnhanceMap;
|
||||||
|
const relationResolverTarget = relationResolversMap[modelName].prototype;
|
||||||
|
const relationResolverActionsConfig = relationResolversEnhanceMap[modelName]!;
|
||||||
|
const allActionsDecorators = relationResolverActionsConfig._all ?? [];
|
||||||
|
const relationResolverActionNames = relationResolversInfo[modelName as keyof typeof relationResolversInfo];
|
||||||
|
for (const relationResolverActionName of relationResolverActionNames) {
|
||||||
|
const maybeDecoratorsOrFn = relationResolverActionsConfig[
|
||||||
|
relationResolverActionName as keyof typeof relationResolverActionsConfig
|
||||||
|
] as MethodDecorator[] | MethodDecoratorOverrideFn | undefined;
|
||||||
|
let decorators: MethodDecorator[];
|
||||||
|
if (typeof maybeDecoratorsOrFn === "function") {
|
||||||
|
decorators = maybeDecoratorsOrFn(allActionsDecorators);
|
||||||
|
} else {
|
||||||
|
decorators = [...allActionsDecorators, ...maybeDecoratorsOrFn ?? []];
|
||||||
|
}
|
||||||
|
tslib.__decorate(decorators, relationResolverTarget, relationResolverActionName, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
type TypeConfig = {
|
||||||
|
class?: ClassDecorator[];
|
||||||
|
fields?: FieldsConfig;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type PropertyDecoratorOverrideFn = (decorators: PropertyDecorator[]) => PropertyDecorator[];
|
||||||
|
|
||||||
|
type FieldsConfig<TTypeKeys extends string = string> = Partial<
|
||||||
|
Record<TTypeKeys, PropertyDecorator[] | PropertyDecoratorOverrideFn>
|
||||||
|
> & { _all?: PropertyDecorator[] };
|
||||||
|
|
||||||
|
function applyTypeClassEnhanceConfig<
|
||||||
|
TEnhanceConfig extends TypeConfig,
|
||||||
|
TType extends object
|
||||||
|
>(
|
||||||
|
enhanceConfig: TEnhanceConfig,
|
||||||
|
typeClass: ClassType<TType>,
|
||||||
|
typePrototype: TType,
|
||||||
|
typeFieldNames: string[]
|
||||||
|
) {
|
||||||
|
if (enhanceConfig.class) {
|
||||||
|
tslib.__decorate(enhanceConfig.class, typeClass);
|
||||||
|
}
|
||||||
|
if (enhanceConfig.fields) {
|
||||||
|
const allFieldsDecorators = enhanceConfig.fields._all ?? [];
|
||||||
|
for (const typeFieldName of typeFieldNames) {
|
||||||
|
const maybeDecoratorsOrFn = enhanceConfig.fields[
|
||||||
|
typeFieldName
|
||||||
|
] as PropertyDecorator[] | PropertyDecoratorOverrideFn | undefined;
|
||||||
|
let decorators: PropertyDecorator[];
|
||||||
|
if (typeof maybeDecoratorsOrFn === "function") {
|
||||||
|
decorators = maybeDecoratorsOrFn(allFieldsDecorators);
|
||||||
|
} else {
|
||||||
|
decorators = [...allFieldsDecorators, ...maybeDecoratorsOrFn ?? []];
|
||||||
|
}
|
||||||
|
tslib.__decorate(decorators, typePrototype, typeFieldName, void 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const modelsInfo = {
|
||||||
|
User: ["id", "createdAt", "updatedAt", "deletedAt", "lastSeen", "disabled", "displayName", "email", "avatarUrl", "locale", "phoneNumber", "passwordHash", "emailVerified", "metadata"],
|
||||||
|
Workspace: ["id", "createdAt", "updatedAt", "deletedAt", "domainName", "displayName"],
|
||||||
|
WorkspaceMember: ["id", "createdAt", "updatedAt", "deletedAt", "userId", "workspaceId"],
|
||||||
|
Company: ["id", "createdAt", "updatedAt", "deletedAt", "name", "domainName", "address", "employees", "accountOwnerId", "workspaceId"],
|
||||||
|
Person: ["id", "createdAt", "updatedAt", "deletedAt", "firstname", "lastname", "email", "phone", "city", "companyId", "workspaceId"],
|
||||||
|
RefreshToken: ["id", "createdAt", "updatedAt", "deletedAt", "refreshToken", "userId"]
|
||||||
|
};
|
||||||
|
|
||||||
|
type ModelNames = keyof typeof models;
|
||||||
|
|
||||||
|
type ModelFieldNames<TModel extends ModelNames> = Exclude<
|
||||||
|
keyof typeof models[TModel]["prototype"],
|
||||||
|
number | symbol
|
||||||
|
>;
|
||||||
|
|
||||||
|
type ModelFieldsConfig<TModel extends ModelNames> = FieldsConfig<
|
||||||
|
ModelFieldNames<TModel>
|
||||||
|
>;
|
||||||
|
|
||||||
|
export type ModelConfig<TModel extends ModelNames> = {
|
||||||
|
class?: ClassDecorator[];
|
||||||
|
fields?: ModelFieldsConfig<TModel>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type ModelsEnhanceMap = {
|
||||||
|
[TModel in ModelNames]?: ModelConfig<TModel>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export function applyModelsEnhanceMap(modelsEnhanceMap: ModelsEnhanceMap) {
|
||||||
|
for (const modelsEnhanceMapKey of Object.keys(modelsEnhanceMap)) {
|
||||||
|
const modelName = modelsEnhanceMapKey as keyof typeof modelsEnhanceMap;
|
||||||
|
const modelConfig = modelsEnhanceMap[modelName]!;
|
||||||
|
const modelClass = models[modelName];
|
||||||
|
const modelTarget = modelClass.prototype;
|
||||||
|
applyTypeClassEnhanceConfig(
|
||||||
|
modelConfig,
|
||||||
|
modelClass,
|
||||||
|
modelTarget,
|
||||||
|
modelsInfo[modelName as keyof typeof modelsInfo],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const outputsInfo = {
|
||||||
|
AggregateUser: ["_count", "_min", "_max"],
|
||||||
|
UserGroupBy: ["id", "createdAt", "updatedAt", "deletedAt", "lastSeen", "disabled", "displayName", "email", "avatarUrl", "locale", "phoneNumber", "passwordHash", "emailVerified", "metadata", "_count", "_min", "_max"],
|
||||||
|
AggregateWorkspace: ["_count", "_min", "_max"],
|
||||||
|
WorkspaceGroupBy: ["id", "createdAt", "updatedAt", "deletedAt", "domainName", "displayName", "_count", "_min", "_max"],
|
||||||
|
AggregateWorkspaceMember: ["_count", "_min", "_max"],
|
||||||
|
WorkspaceMemberGroupBy: ["id", "createdAt", "updatedAt", "deletedAt", "userId", "workspaceId", "_count", "_min", "_max"],
|
||||||
|
AggregateCompany: ["_count", "_avg", "_sum", "_min", "_max"],
|
||||||
|
CompanyGroupBy: ["id", "createdAt", "updatedAt", "deletedAt", "name", "domainName", "address", "employees", "accountOwnerId", "workspaceId", "_count", "_avg", "_sum", "_min", "_max"],
|
||||||
|
AggregatePerson: ["_count", "_min", "_max"],
|
||||||
|
PersonGroupBy: ["id", "createdAt", "updatedAt", "deletedAt", "firstname", "lastname", "email", "phone", "city", "companyId", "workspaceId", "_count", "_min", "_max"],
|
||||||
|
AggregateRefreshToken: ["_count", "_min", "_max"],
|
||||||
|
RefreshTokenGroupBy: ["id", "createdAt", "updatedAt", "deletedAt", "refreshToken", "userId", "_count", "_min", "_max"],
|
||||||
|
AffectedRowsOutput: ["count"],
|
||||||
|
UserCount: ["companies", "RefreshTokens"],
|
||||||
|
UserCountAggregate: ["id", "createdAt", "updatedAt", "deletedAt", "lastSeen", "disabled", "displayName", "email", "avatarUrl", "locale", "phoneNumber", "passwordHash", "emailVerified", "metadata", "_all"],
|
||||||
|
UserMinAggregate: ["id", "createdAt", "updatedAt", "deletedAt", "lastSeen", "disabled", "displayName", "email", "avatarUrl", "locale", "phoneNumber", "passwordHash", "emailVerified"],
|
||||||
|
UserMaxAggregate: ["id", "createdAt", "updatedAt", "deletedAt", "lastSeen", "disabled", "displayName", "email", "avatarUrl", "locale", "phoneNumber", "passwordHash", "emailVerified"],
|
||||||
|
WorkspaceCount: ["WorkspaceMember", "companies", "people"],
|
||||||
|
WorkspaceCountAggregate: ["id", "createdAt", "updatedAt", "deletedAt", "domainName", "displayName", "_all"],
|
||||||
|
WorkspaceMinAggregate: ["id", "createdAt", "updatedAt", "deletedAt", "domainName", "displayName"],
|
||||||
|
WorkspaceMaxAggregate: ["id", "createdAt", "updatedAt", "deletedAt", "domainName", "displayName"],
|
||||||
|
WorkspaceMemberCountAggregate: ["id", "createdAt", "updatedAt", "deletedAt", "userId", "workspaceId", "_all"],
|
||||||
|
WorkspaceMemberMinAggregate: ["id", "createdAt", "updatedAt", "deletedAt", "userId", "workspaceId"],
|
||||||
|
WorkspaceMemberMaxAggregate: ["id", "createdAt", "updatedAt", "deletedAt", "userId", "workspaceId"],
|
||||||
|
CompanyCount: ["people"],
|
||||||
|
CompanyCountAggregate: ["id", "createdAt", "updatedAt", "deletedAt", "name", "domainName", "address", "employees", "accountOwnerId", "workspaceId", "_all"],
|
||||||
|
CompanyAvgAggregate: ["employees"],
|
||||||
|
CompanySumAggregate: ["employees"],
|
||||||
|
CompanyMinAggregate: ["id", "createdAt", "updatedAt", "deletedAt", "name", "domainName", "address", "employees", "accountOwnerId", "workspaceId"],
|
||||||
|
CompanyMaxAggregate: ["id", "createdAt", "updatedAt", "deletedAt", "name", "domainName", "address", "employees", "accountOwnerId", "workspaceId"],
|
||||||
|
PersonCountAggregate: ["id", "createdAt", "updatedAt", "deletedAt", "firstname", "lastname", "email", "phone", "city", "companyId", "workspaceId", "_all"],
|
||||||
|
PersonMinAggregate: ["id", "createdAt", "updatedAt", "deletedAt", "firstname", "lastname", "email", "phone", "city", "companyId", "workspaceId"],
|
||||||
|
PersonMaxAggregate: ["id", "createdAt", "updatedAt", "deletedAt", "firstname", "lastname", "email", "phone", "city", "companyId", "workspaceId"],
|
||||||
|
RefreshTokenCountAggregate: ["id", "createdAt", "updatedAt", "deletedAt", "refreshToken", "userId", "_all"],
|
||||||
|
RefreshTokenMinAggregate: ["id", "createdAt", "updatedAt", "deletedAt", "refreshToken", "userId"],
|
||||||
|
RefreshTokenMaxAggregate: ["id", "createdAt", "updatedAt", "deletedAt", "refreshToken", "userId"]
|
||||||
|
};
|
||||||
|
|
||||||
|
type OutputTypesNames = keyof typeof outputTypes;
|
||||||
|
|
||||||
|
type OutputTypeFieldNames<TOutput extends OutputTypesNames> = Exclude<
|
||||||
|
keyof typeof outputTypes[TOutput]["prototype"],
|
||||||
|
number | symbol
|
||||||
|
>;
|
||||||
|
|
||||||
|
type OutputTypeFieldsConfig<
|
||||||
|
TOutput extends OutputTypesNames
|
||||||
|
> = FieldsConfig<OutputTypeFieldNames<TOutput>>;
|
||||||
|
|
||||||
|
export type OutputTypeConfig<TOutput extends OutputTypesNames> = {
|
||||||
|
class?: ClassDecorator[];
|
||||||
|
fields?: OutputTypeFieldsConfig<TOutput>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type OutputTypesEnhanceMap = {
|
||||||
|
[TOutput in OutputTypesNames]?: OutputTypeConfig<TOutput>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export function applyOutputTypesEnhanceMap(
|
||||||
|
outputTypesEnhanceMap: OutputTypesEnhanceMap,
|
||||||
|
) {
|
||||||
|
for (const outputTypeEnhanceMapKey of Object.keys(outputTypesEnhanceMap)) {
|
||||||
|
const outputTypeName = outputTypeEnhanceMapKey as keyof typeof outputTypesEnhanceMap;
|
||||||
|
const typeConfig = outputTypesEnhanceMap[outputTypeName]!;
|
||||||
|
const typeClass = outputTypes[outputTypeName];
|
||||||
|
const typeTarget = typeClass.prototype;
|
||||||
|
applyTypeClassEnhanceConfig(
|
||||||
|
typeConfig,
|
||||||
|
typeClass,
|
||||||
|
typeTarget,
|
||||||
|
outputsInfo[outputTypeName as keyof typeof outputsInfo],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const inputsInfo = {
|
||||||
|
UserWhereInput: ["AND", "OR", "NOT", "id", "createdAt", "updatedAt", "deletedAt", "lastSeen", "disabled", "displayName", "email", "avatarUrl", "locale", "phoneNumber", "passwordHash", "emailVerified", "metadata", "WorkspaceMember", "companies", "RefreshTokens"],
|
||||||
|
UserOrderByWithRelationInput: ["id", "createdAt", "updatedAt", "deletedAt", "lastSeen", "disabled", "displayName", "email", "avatarUrl", "locale", "phoneNumber", "passwordHash", "emailVerified", "metadata", "WorkspaceMember", "companies", "RefreshTokens"],
|
||||||
|
UserWhereUniqueInput: ["id", "email"],
|
||||||
|
UserOrderByWithAggregationInput: ["id", "createdAt", "updatedAt", "deletedAt", "lastSeen", "disabled", "displayName", "email", "avatarUrl", "locale", "phoneNumber", "passwordHash", "emailVerified", "metadata", "_count", "_max", "_min"],
|
||||||
|
UserScalarWhereWithAggregatesInput: ["AND", "OR", "NOT", "id", "createdAt", "updatedAt", "deletedAt", "lastSeen", "disabled", "displayName", "email", "avatarUrl", "locale", "phoneNumber", "passwordHash", "emailVerified", "metadata"],
|
||||||
|
WorkspaceWhereInput: ["AND", "OR", "NOT", "id", "createdAt", "updatedAt", "deletedAt", "domainName", "displayName", "WorkspaceMember", "companies", "people"],
|
||||||
|
WorkspaceOrderByWithRelationInput: ["id", "createdAt", "updatedAt", "deletedAt", "domainName", "displayName", "WorkspaceMember", "companies", "people"],
|
||||||
|
WorkspaceWhereUniqueInput: ["id", "domainName"],
|
||||||
|
WorkspaceOrderByWithAggregationInput: ["id", "createdAt", "updatedAt", "deletedAt", "domainName", "displayName", "_count", "_max", "_min"],
|
||||||
|
WorkspaceScalarWhereWithAggregatesInput: ["AND", "OR", "NOT", "id", "createdAt", "updatedAt", "deletedAt", "domainName", "displayName"],
|
||||||
|
WorkspaceMemberWhereInput: ["AND", "OR", "NOT", "id", "createdAt", "updatedAt", "deletedAt", "userId", "workspaceId", "user", "workspace"],
|
||||||
|
WorkspaceMemberOrderByWithRelationInput: ["id", "createdAt", "updatedAt", "deletedAt", "userId", "workspaceId", "user", "workspace"],
|
||||||
|
WorkspaceMemberWhereUniqueInput: ["id", "userId"],
|
||||||
|
WorkspaceMemberOrderByWithAggregationInput: ["id", "createdAt", "updatedAt", "deletedAt", "userId", "workspaceId", "_count", "_max", "_min"],
|
||||||
|
WorkspaceMemberScalarWhereWithAggregatesInput: ["AND", "OR", "NOT", "id", "createdAt", "updatedAt", "deletedAt", "userId", "workspaceId"],
|
||||||
|
CompanyWhereInput: ["AND", "OR", "NOT", "id", "createdAt", "updatedAt", "deletedAt", "name", "domainName", "address", "employees", "accountOwnerId", "workspaceId", "accountOwner", "people", "workspace"],
|
||||||
|
CompanyOrderByWithRelationInput: ["id", "createdAt", "updatedAt", "deletedAt", "name", "domainName", "address", "employees", "accountOwnerId", "workspaceId", "accountOwner", "people", "workspace"],
|
||||||
|
CompanyWhereUniqueInput: ["id"],
|
||||||
|
CompanyOrderByWithAggregationInput: ["id", "createdAt", "updatedAt", "deletedAt", "name", "domainName", "address", "employees", "accountOwnerId", "workspaceId", "_count", "_avg", "_max", "_min", "_sum"],
|
||||||
|
CompanyScalarWhereWithAggregatesInput: ["AND", "OR", "NOT", "id", "createdAt", "updatedAt", "deletedAt", "name", "domainName", "address", "employees", "accountOwnerId", "workspaceId"],
|
||||||
|
PersonWhereInput: ["AND", "OR", "NOT", "id", "createdAt", "updatedAt", "deletedAt", "firstname", "lastname", "email", "phone", "city", "companyId", "workspaceId", "company", "workspace"],
|
||||||
|
PersonOrderByWithRelationInput: ["id", "createdAt", "updatedAt", "deletedAt", "firstname", "lastname", "email", "phone", "city", "companyId", "workspaceId", "company", "workspace"],
|
||||||
|
PersonWhereUniqueInput: ["id"],
|
||||||
|
PersonOrderByWithAggregationInput: ["id", "createdAt", "updatedAt", "deletedAt", "firstname", "lastname", "email", "phone", "city", "companyId", "workspaceId", "_count", "_max", "_min"],
|
||||||
|
PersonScalarWhereWithAggregatesInput: ["AND", "OR", "NOT", "id", "createdAt", "updatedAt", "deletedAt", "firstname", "lastname", "email", "phone", "city", "companyId", "workspaceId"],
|
||||||
|
RefreshTokenWhereInput: ["AND", "OR", "NOT", "id", "createdAt", "updatedAt", "deletedAt", "refreshToken", "userId", "user"],
|
||||||
|
RefreshTokenOrderByWithRelationInput: ["id", "createdAt", "updatedAt", "deletedAt", "refreshToken", "userId", "user"],
|
||||||
|
RefreshTokenWhereUniqueInput: ["id"],
|
||||||
|
RefreshTokenOrderByWithAggregationInput: ["id", "createdAt", "updatedAt", "deletedAt", "refreshToken", "userId", "_count", "_max", "_min"],
|
||||||
|
RefreshTokenScalarWhereWithAggregatesInput: ["AND", "OR", "NOT", "id", "createdAt", "updatedAt", "deletedAt", "refreshToken", "userId"],
|
||||||
|
UserCreateInput: ["id", "createdAt", "updatedAt", "deletedAt", "lastSeen", "disabled", "displayName", "email", "avatarUrl", "locale", "phoneNumber", "passwordHash", "emailVerified", "metadata", "WorkspaceMember", "companies", "RefreshTokens"],
|
||||||
|
UserUpdateInput: ["id", "createdAt", "updatedAt", "deletedAt", "lastSeen", "disabled", "displayName", "email", "avatarUrl", "locale", "phoneNumber", "passwordHash", "emailVerified", "metadata", "WorkspaceMember", "companies", "RefreshTokens"],
|
||||||
|
UserCreateManyInput: ["id", "createdAt", "updatedAt", "deletedAt", "lastSeen", "disabled", "displayName", "email", "avatarUrl", "locale", "phoneNumber", "passwordHash", "emailVerified", "metadata"],
|
||||||
|
UserUpdateManyMutationInput: ["id", "createdAt", "updatedAt", "deletedAt", "lastSeen", "disabled", "displayName", "email", "avatarUrl", "locale", "phoneNumber", "passwordHash", "emailVerified", "metadata"],
|
||||||
|
WorkspaceCreateInput: ["id", "createdAt", "updatedAt", "deletedAt", "domainName", "displayName", "WorkspaceMember", "companies", "people"],
|
||||||
|
WorkspaceUpdateInput: ["id", "createdAt", "updatedAt", "deletedAt", "domainName", "displayName", "WorkspaceMember", "companies", "people"],
|
||||||
|
WorkspaceCreateManyInput: ["id", "createdAt", "updatedAt", "deletedAt", "domainName", "displayName"],
|
||||||
|
WorkspaceUpdateManyMutationInput: ["id", "createdAt", "updatedAt", "deletedAt", "domainName", "displayName"],
|
||||||
|
WorkspaceMemberCreateInput: ["id", "createdAt", "updatedAt", "deletedAt", "user", "workspace"],
|
||||||
|
WorkspaceMemberUpdateInput: ["id", "createdAt", "updatedAt", "deletedAt", "user", "workspace"],
|
||||||
|
WorkspaceMemberCreateManyInput: ["id", "createdAt", "updatedAt", "deletedAt", "userId", "workspaceId"],
|
||||||
|
WorkspaceMemberUpdateManyMutationInput: ["id", "createdAt", "updatedAt", "deletedAt"],
|
||||||
|
CompanyCreateInput: ["id", "createdAt", "updatedAt", "deletedAt", "name", "domainName", "address", "employees", "accountOwner", "people", "workspace"],
|
||||||
|
CompanyUpdateInput: ["id", "createdAt", "updatedAt", "deletedAt", "name", "domainName", "address", "employees", "accountOwner", "people", "workspace"],
|
||||||
|
CompanyCreateManyInput: ["id", "createdAt", "updatedAt", "deletedAt", "name", "domainName", "address", "employees", "accountOwnerId", "workspaceId"],
|
||||||
|
CompanyUpdateManyMutationInput: ["id", "createdAt", "updatedAt", "deletedAt", "name", "domainName", "address", "employees"],
|
||||||
|
PersonCreateInput: ["id", "createdAt", "updatedAt", "deletedAt", "firstname", "lastname", "email", "phone", "city", "company", "workspace"],
|
||||||
|
PersonUpdateInput: ["id", "createdAt", "updatedAt", "deletedAt", "firstname", "lastname", "email", "phone", "city", "company", "workspace"],
|
||||||
|
PersonCreateManyInput: ["id", "createdAt", "updatedAt", "deletedAt", "firstname", "lastname", "email", "phone", "city", "companyId", "workspaceId"],
|
||||||
|
PersonUpdateManyMutationInput: ["id", "createdAt", "updatedAt", "deletedAt", "firstname", "lastname", "email", "phone", "city"],
|
||||||
|
RefreshTokenCreateInput: ["id", "createdAt", "updatedAt", "deletedAt", "refreshToken", "user"],
|
||||||
|
RefreshTokenUpdateInput: ["id", "createdAt", "updatedAt", "deletedAt", "refreshToken", "user"],
|
||||||
|
RefreshTokenCreateManyInput: ["id", "createdAt", "updatedAt", "deletedAt", "refreshToken", "userId"],
|
||||||
|
RefreshTokenUpdateManyMutationInput: ["id", "createdAt", "updatedAt", "deletedAt", "refreshToken"],
|
||||||
|
StringFilter: ["equals", "in", "notIn", "lt", "lte", "gt", "gte", "contains", "startsWith", "endsWith", "mode", "not"],
|
||||||
|
DateTimeFilter: ["equals", "in", "notIn", "lt", "lte", "gt", "gte", "not"],
|
||||||
|
DateTimeNullableFilter: ["equals", "in", "notIn", "lt", "lte", "gt", "gte", "not"],
|
||||||
|
BoolFilter: ["equals", "not"],
|
||||||
|
StringNullableFilter: ["equals", "in", "notIn", "lt", "lte", "gt", "gte", "contains", "startsWith", "endsWith", "mode", "not"],
|
||||||
|
JsonNullableFilter: ["equals", "path", "string_contains", "string_starts_with", "string_ends_with", "array_contains", "array_starts_with", "array_ends_with", "lt", "lte", "gt", "gte", "not"],
|
||||||
|
WorkspaceMemberRelationFilter: ["is", "isNot"],
|
||||||
|
CompanyListRelationFilter: ["every", "some", "none"],
|
||||||
|
RefreshTokenListRelationFilter: ["every", "some", "none"],
|
||||||
|
CompanyOrderByRelationAggregateInput: ["_count"],
|
||||||
|
RefreshTokenOrderByRelationAggregateInput: ["_count"],
|
||||||
|
UserCountOrderByAggregateInput: ["id", "createdAt", "updatedAt", "deletedAt", "lastSeen", "disabled", "displayName", "email", "avatarUrl", "locale", "phoneNumber", "passwordHash", "emailVerified", "metadata"],
|
||||||
|
UserMaxOrderByAggregateInput: ["id", "createdAt", "updatedAt", "deletedAt", "lastSeen", "disabled", "displayName", "email", "avatarUrl", "locale", "phoneNumber", "passwordHash", "emailVerified"],
|
||||||
|
UserMinOrderByAggregateInput: ["id", "createdAt", "updatedAt", "deletedAt", "lastSeen", "disabled", "displayName", "email", "avatarUrl", "locale", "phoneNumber", "passwordHash", "emailVerified"],
|
||||||
|
StringWithAggregatesFilter: ["equals", "in", "notIn", "lt", "lte", "gt", "gte", "contains", "startsWith", "endsWith", "mode", "not", "_count", "_min", "_max"],
|
||||||
|
DateTimeWithAggregatesFilter: ["equals", "in", "notIn", "lt", "lte", "gt", "gte", "not", "_count", "_min", "_max"],
|
||||||
|
DateTimeNullableWithAggregatesFilter: ["equals", "in", "notIn", "lt", "lte", "gt", "gte", "not", "_count", "_min", "_max"],
|
||||||
|
BoolWithAggregatesFilter: ["equals", "not", "_count", "_min", "_max"],
|
||||||
|
StringNullableWithAggregatesFilter: ["equals", "in", "notIn", "lt", "lte", "gt", "gte", "contains", "startsWith", "endsWith", "mode", "not", "_count", "_min", "_max"],
|
||||||
|
JsonNullableWithAggregatesFilter: ["equals", "path", "string_contains", "string_starts_with", "string_ends_with", "array_contains", "array_starts_with", "array_ends_with", "lt", "lte", "gt", "gte", "not", "_count", "_min", "_max"],
|
||||||
|
WorkspaceMemberListRelationFilter: ["every", "some", "none"],
|
||||||
|
PersonListRelationFilter: ["every", "some", "none"],
|
||||||
|
WorkspaceMemberOrderByRelationAggregateInput: ["_count"],
|
||||||
|
PersonOrderByRelationAggregateInput: ["_count"],
|
||||||
|
WorkspaceCountOrderByAggregateInput: ["id", "createdAt", "updatedAt", "deletedAt", "domainName", "displayName"],
|
||||||
|
WorkspaceMaxOrderByAggregateInput: ["id", "createdAt", "updatedAt", "deletedAt", "domainName", "displayName"],
|
||||||
|
WorkspaceMinOrderByAggregateInput: ["id", "createdAt", "updatedAt", "deletedAt", "domainName", "displayName"],
|
||||||
|
UserRelationFilter: ["is", "isNot"],
|
||||||
|
WorkspaceRelationFilter: ["is", "isNot"],
|
||||||
|
WorkspaceMemberCountOrderByAggregateInput: ["id", "createdAt", "updatedAt", "deletedAt", "userId", "workspaceId"],
|
||||||
|
WorkspaceMemberMaxOrderByAggregateInput: ["id", "createdAt", "updatedAt", "deletedAt", "userId", "workspaceId"],
|
||||||
|
WorkspaceMemberMinOrderByAggregateInput: ["id", "createdAt", "updatedAt", "deletedAt", "userId", "workspaceId"],
|
||||||
|
IntNullableFilter: ["equals", "in", "notIn", "lt", "lte", "gt", "gte", "not"],
|
||||||
|
CompanyCountOrderByAggregateInput: ["id", "createdAt", "updatedAt", "deletedAt", "name", "domainName", "address", "employees", "accountOwnerId", "workspaceId"],
|
||||||
|
CompanyAvgOrderByAggregateInput: ["employees"],
|
||||||
|
CompanyMaxOrderByAggregateInput: ["id", "createdAt", "updatedAt", "deletedAt", "name", "domainName", "address", "employees", "accountOwnerId", "workspaceId"],
|
||||||
|
CompanyMinOrderByAggregateInput: ["id", "createdAt", "updatedAt", "deletedAt", "name", "domainName", "address", "employees", "accountOwnerId", "workspaceId"],
|
||||||
|
CompanySumOrderByAggregateInput: ["employees"],
|
||||||
|
IntNullableWithAggregatesFilter: ["equals", "in", "notIn", "lt", "lte", "gt", "gte", "not", "_count", "_avg", "_sum", "_min", "_max"],
|
||||||
|
CompanyRelationFilter: ["is", "isNot"],
|
||||||
|
PersonCountOrderByAggregateInput: ["id", "createdAt", "updatedAt", "deletedAt", "firstname", "lastname", "email", "phone", "city", "companyId", "workspaceId"],
|
||||||
|
PersonMaxOrderByAggregateInput: ["id", "createdAt", "updatedAt", "deletedAt", "firstname", "lastname", "email", "phone", "city", "companyId", "workspaceId"],
|
||||||
|
PersonMinOrderByAggregateInput: ["id", "createdAt", "updatedAt", "deletedAt", "firstname", "lastname", "email", "phone", "city", "companyId", "workspaceId"],
|
||||||
|
RefreshTokenCountOrderByAggregateInput: ["id", "createdAt", "updatedAt", "deletedAt", "refreshToken", "userId"],
|
||||||
|
RefreshTokenMaxOrderByAggregateInput: ["id", "createdAt", "updatedAt", "deletedAt", "refreshToken", "userId"],
|
||||||
|
RefreshTokenMinOrderByAggregateInput: ["id", "createdAt", "updatedAt", "deletedAt", "refreshToken", "userId"],
|
||||||
|
WorkspaceMemberCreateNestedOneWithoutUserInput: ["create", "connectOrCreate", "connect"],
|
||||||
|
CompanyCreateNestedManyWithoutAccountOwnerInput: ["create", "connectOrCreate", "createMany", "connect"],
|
||||||
|
RefreshTokenCreateNestedManyWithoutUserInput: ["create", "connectOrCreate", "createMany", "connect"],
|
||||||
|
StringFieldUpdateOperationsInput: ["set"],
|
||||||
|
DateTimeFieldUpdateOperationsInput: ["set"],
|
||||||
|
NullableDateTimeFieldUpdateOperationsInput: ["set"],
|
||||||
|
BoolFieldUpdateOperationsInput: ["set"],
|
||||||
|
NullableStringFieldUpdateOperationsInput: ["set"],
|
||||||
|
WorkspaceMemberUpdateOneWithoutUserNestedInput: ["create", "connectOrCreate", "upsert", "disconnect", "delete", "connect", "update"],
|
||||||
|
CompanyUpdateManyWithoutAccountOwnerNestedInput: ["create", "connectOrCreate", "upsert", "createMany", "set", "disconnect", "delete", "connect", "update", "updateMany", "deleteMany"],
|
||||||
|
RefreshTokenUpdateManyWithoutUserNestedInput: ["create", "connectOrCreate", "upsert", "createMany", "set", "disconnect", "delete", "connect", "update", "updateMany", "deleteMany"],
|
||||||
|
WorkspaceMemberCreateNestedManyWithoutWorkspaceInput: ["create", "connectOrCreate", "createMany", "connect"],
|
||||||
|
CompanyCreateNestedManyWithoutWorkspaceInput: ["create", "connectOrCreate", "createMany", "connect"],
|
||||||
|
PersonCreateNestedManyWithoutWorkspaceInput: ["create", "connectOrCreate", "createMany", "connect"],
|
||||||
|
WorkspaceMemberUpdateManyWithoutWorkspaceNestedInput: ["create", "connectOrCreate", "upsert", "createMany", "set", "disconnect", "delete", "connect", "update", "updateMany", "deleteMany"],
|
||||||
|
CompanyUpdateManyWithoutWorkspaceNestedInput: ["create", "connectOrCreate", "upsert", "createMany", "set", "disconnect", "delete", "connect", "update", "updateMany", "deleteMany"],
|
||||||
|
PersonUpdateManyWithoutWorkspaceNestedInput: ["create", "connectOrCreate", "upsert", "createMany", "set", "disconnect", "delete", "connect", "update", "updateMany", "deleteMany"],
|
||||||
|
UserCreateNestedOneWithoutWorkspaceMemberInput: ["create", "connectOrCreate", "connect"],
|
||||||
|
WorkspaceCreateNestedOneWithoutWorkspaceMemberInput: ["create", "connectOrCreate", "connect"],
|
||||||
|
UserUpdateOneRequiredWithoutWorkspaceMemberNestedInput: ["create", "connectOrCreate", "upsert", "connect", "update"],
|
||||||
|
WorkspaceUpdateOneRequiredWithoutWorkspaceMemberNestedInput: ["create", "connectOrCreate", "upsert", "connect", "update"],
|
||||||
|
UserCreateNestedOneWithoutCompaniesInput: ["create", "connectOrCreate", "connect"],
|
||||||
|
PersonCreateNestedManyWithoutCompanyInput: ["create", "connectOrCreate", "createMany", "connect"],
|
||||||
|
WorkspaceCreateNestedOneWithoutCompaniesInput: ["create", "connectOrCreate", "connect"],
|
||||||
|
NullableIntFieldUpdateOperationsInput: ["set", "increment", "decrement", "multiply", "divide"],
|
||||||
|
UserUpdateOneWithoutCompaniesNestedInput: ["create", "connectOrCreate", "upsert", "disconnect", "delete", "connect", "update"],
|
||||||
|
PersonUpdateManyWithoutCompanyNestedInput: ["create", "connectOrCreate", "upsert", "createMany", "set", "disconnect", "delete", "connect", "update", "updateMany", "deleteMany"],
|
||||||
|
WorkspaceUpdateOneRequiredWithoutCompaniesNestedInput: ["create", "connectOrCreate", "upsert", "connect", "update"],
|
||||||
|
CompanyCreateNestedOneWithoutPeopleInput: ["create", "connectOrCreate", "connect"],
|
||||||
|
WorkspaceCreateNestedOneWithoutPeopleInput: ["create", "connectOrCreate", "connect"],
|
||||||
|
CompanyUpdateOneWithoutPeopleNestedInput: ["create", "connectOrCreate", "upsert", "disconnect", "delete", "connect", "update"],
|
||||||
|
WorkspaceUpdateOneRequiredWithoutPeopleNestedInput: ["create", "connectOrCreate", "upsert", "connect", "update"],
|
||||||
|
UserCreateNestedOneWithoutRefreshTokensInput: ["create", "connectOrCreate", "connect"],
|
||||||
|
UserUpdateOneRequiredWithoutRefreshTokensNestedInput: ["create", "connectOrCreate", "upsert", "connect", "update"],
|
||||||
|
NestedStringFilter: ["equals", "in", "notIn", "lt", "lte", "gt", "gte", "contains", "startsWith", "endsWith", "not"],
|
||||||
|
NestedDateTimeFilter: ["equals", "in", "notIn", "lt", "lte", "gt", "gte", "not"],
|
||||||
|
NestedDateTimeNullableFilter: ["equals", "in", "notIn", "lt", "lte", "gt", "gte", "not"],
|
||||||
|
NestedBoolFilter: ["equals", "not"],
|
||||||
|
NestedStringNullableFilter: ["equals", "in", "notIn", "lt", "lte", "gt", "gte", "contains", "startsWith", "endsWith", "not"],
|
||||||
|
NestedStringWithAggregatesFilter: ["equals", "in", "notIn", "lt", "lte", "gt", "gte", "contains", "startsWith", "endsWith", "not", "_count", "_min", "_max"],
|
||||||
|
NestedIntFilter: ["equals", "in", "notIn", "lt", "lte", "gt", "gte", "not"],
|
||||||
|
NestedDateTimeWithAggregatesFilter: ["equals", "in", "notIn", "lt", "lte", "gt", "gte", "not", "_count", "_min", "_max"],
|
||||||
|
NestedDateTimeNullableWithAggregatesFilter: ["equals", "in", "notIn", "lt", "lte", "gt", "gte", "not", "_count", "_min", "_max"],
|
||||||
|
NestedIntNullableFilter: ["equals", "in", "notIn", "lt", "lte", "gt", "gte", "not"],
|
||||||
|
NestedBoolWithAggregatesFilter: ["equals", "not", "_count", "_min", "_max"],
|
||||||
|
NestedStringNullableWithAggregatesFilter: ["equals", "in", "notIn", "lt", "lte", "gt", "gte", "contains", "startsWith", "endsWith", "not", "_count", "_min", "_max"],
|
||||||
|
NestedJsonNullableFilter: ["equals", "path", "string_contains", "string_starts_with", "string_ends_with", "array_contains", "array_starts_with", "array_ends_with", "lt", "lte", "gt", "gte", "not"],
|
||||||
|
NestedIntNullableWithAggregatesFilter: ["equals", "in", "notIn", "lt", "lte", "gt", "gte", "not", "_count", "_avg", "_sum", "_min", "_max"],
|
||||||
|
NestedFloatNullableFilter: ["equals", "in", "notIn", "lt", "lte", "gt", "gte", "not"],
|
||||||
|
WorkspaceMemberCreateWithoutUserInput: ["id", "createdAt", "updatedAt", "deletedAt", "workspace"],
|
||||||
|
WorkspaceMemberCreateOrConnectWithoutUserInput: ["where", "create"],
|
||||||
|
CompanyCreateWithoutAccountOwnerInput: ["id", "createdAt", "updatedAt", "deletedAt", "name", "domainName", "address", "employees", "people", "workspace"],
|
||||||
|
CompanyCreateOrConnectWithoutAccountOwnerInput: ["where", "create"],
|
||||||
|
CompanyCreateManyAccountOwnerInputEnvelope: ["data", "skipDuplicates"],
|
||||||
|
RefreshTokenCreateWithoutUserInput: ["id", "createdAt", "updatedAt", "deletedAt", "refreshToken"],
|
||||||
|
RefreshTokenCreateOrConnectWithoutUserInput: ["where", "create"],
|
||||||
|
RefreshTokenCreateManyUserInputEnvelope: ["data", "skipDuplicates"],
|
||||||
|
WorkspaceMemberUpsertWithoutUserInput: ["update", "create"],
|
||||||
|
WorkspaceMemberUpdateWithoutUserInput: ["id", "createdAt", "updatedAt", "deletedAt", "workspace"],
|
||||||
|
CompanyUpsertWithWhereUniqueWithoutAccountOwnerInput: ["where", "update", "create"],
|
||||||
|
CompanyUpdateWithWhereUniqueWithoutAccountOwnerInput: ["where", "data"],
|
||||||
|
CompanyUpdateManyWithWhereWithoutAccountOwnerInput: ["where", "data"],
|
||||||
|
CompanyScalarWhereInput: ["AND", "OR", "NOT", "id", "createdAt", "updatedAt", "deletedAt", "name", "domainName", "address", "employees", "accountOwnerId", "workspaceId"],
|
||||||
|
RefreshTokenUpsertWithWhereUniqueWithoutUserInput: ["where", "update", "create"],
|
||||||
|
RefreshTokenUpdateWithWhereUniqueWithoutUserInput: ["where", "data"],
|
||||||
|
RefreshTokenUpdateManyWithWhereWithoutUserInput: ["where", "data"],
|
||||||
|
RefreshTokenScalarWhereInput: ["AND", "OR", "NOT", "id", "createdAt", "updatedAt", "deletedAt", "refreshToken", "userId"],
|
||||||
|
WorkspaceMemberCreateWithoutWorkspaceInput: ["id", "createdAt", "updatedAt", "deletedAt", "user"],
|
||||||
|
WorkspaceMemberCreateOrConnectWithoutWorkspaceInput: ["where", "create"],
|
||||||
|
WorkspaceMemberCreateManyWorkspaceInputEnvelope: ["data", "skipDuplicates"],
|
||||||
|
CompanyCreateWithoutWorkspaceInput: ["id", "createdAt", "updatedAt", "deletedAt", "name", "domainName", "address", "employees", "accountOwner", "people"],
|
||||||
|
CompanyCreateOrConnectWithoutWorkspaceInput: ["where", "create"],
|
||||||
|
CompanyCreateManyWorkspaceInputEnvelope: ["data", "skipDuplicates"],
|
||||||
|
PersonCreateWithoutWorkspaceInput: ["id", "createdAt", "updatedAt", "deletedAt", "firstname", "lastname", "email", "phone", "city", "company"],
|
||||||
|
PersonCreateOrConnectWithoutWorkspaceInput: ["where", "create"],
|
||||||
|
PersonCreateManyWorkspaceInputEnvelope: ["data", "skipDuplicates"],
|
||||||
|
WorkspaceMemberUpsertWithWhereUniqueWithoutWorkspaceInput: ["where", "update", "create"],
|
||||||
|
WorkspaceMemberUpdateWithWhereUniqueWithoutWorkspaceInput: ["where", "data"],
|
||||||
|
WorkspaceMemberUpdateManyWithWhereWithoutWorkspaceInput: ["where", "data"],
|
||||||
|
WorkspaceMemberScalarWhereInput: ["AND", "OR", "NOT", "id", "createdAt", "updatedAt", "deletedAt", "userId", "workspaceId"],
|
||||||
|
CompanyUpsertWithWhereUniqueWithoutWorkspaceInput: ["where", "update", "create"],
|
||||||
|
CompanyUpdateWithWhereUniqueWithoutWorkspaceInput: ["where", "data"],
|
||||||
|
CompanyUpdateManyWithWhereWithoutWorkspaceInput: ["where", "data"],
|
||||||
|
PersonUpsertWithWhereUniqueWithoutWorkspaceInput: ["where", "update", "create"],
|
||||||
|
PersonUpdateWithWhereUniqueWithoutWorkspaceInput: ["where", "data"],
|
||||||
|
PersonUpdateManyWithWhereWithoutWorkspaceInput: ["where", "data"],
|
||||||
|
PersonScalarWhereInput: ["AND", "OR", "NOT", "id", "createdAt", "updatedAt", "deletedAt", "firstname", "lastname", "email", "phone", "city", "companyId", "workspaceId"],
|
||||||
|
UserCreateWithoutWorkspaceMemberInput: ["id", "createdAt", "updatedAt", "deletedAt", "lastSeen", "disabled", "displayName", "email", "avatarUrl", "locale", "phoneNumber", "passwordHash", "emailVerified", "metadata", "companies", "RefreshTokens"],
|
||||||
|
UserCreateOrConnectWithoutWorkspaceMemberInput: ["where", "create"],
|
||||||
|
WorkspaceCreateWithoutWorkspaceMemberInput: ["id", "createdAt", "updatedAt", "deletedAt", "domainName", "displayName", "companies", "people"],
|
||||||
|
WorkspaceCreateOrConnectWithoutWorkspaceMemberInput: ["where", "create"],
|
||||||
|
UserUpsertWithoutWorkspaceMemberInput: ["update", "create"],
|
||||||
|
UserUpdateWithoutWorkspaceMemberInput: ["id", "createdAt", "updatedAt", "deletedAt", "lastSeen", "disabled", "displayName", "email", "avatarUrl", "locale", "phoneNumber", "passwordHash", "emailVerified", "metadata", "companies", "RefreshTokens"],
|
||||||
|
WorkspaceUpsertWithoutWorkspaceMemberInput: ["update", "create"],
|
||||||
|
WorkspaceUpdateWithoutWorkspaceMemberInput: ["id", "createdAt", "updatedAt", "deletedAt", "domainName", "displayName", "companies", "people"],
|
||||||
|
UserCreateWithoutCompaniesInput: ["id", "createdAt", "updatedAt", "deletedAt", "lastSeen", "disabled", "displayName", "email", "avatarUrl", "locale", "phoneNumber", "passwordHash", "emailVerified", "metadata", "WorkspaceMember", "RefreshTokens"],
|
||||||
|
UserCreateOrConnectWithoutCompaniesInput: ["where", "create"],
|
||||||
|
PersonCreateWithoutCompanyInput: ["id", "createdAt", "updatedAt", "deletedAt", "firstname", "lastname", "email", "phone", "city", "workspace"],
|
||||||
|
PersonCreateOrConnectWithoutCompanyInput: ["where", "create"],
|
||||||
|
PersonCreateManyCompanyInputEnvelope: ["data", "skipDuplicates"],
|
||||||
|
WorkspaceCreateWithoutCompaniesInput: ["id", "createdAt", "updatedAt", "deletedAt", "domainName", "displayName", "WorkspaceMember", "people"],
|
||||||
|
WorkspaceCreateOrConnectWithoutCompaniesInput: ["where", "create"],
|
||||||
|
UserUpsertWithoutCompaniesInput: ["update", "create"],
|
||||||
|
UserUpdateWithoutCompaniesInput: ["id", "createdAt", "updatedAt", "deletedAt", "lastSeen", "disabled", "displayName", "email", "avatarUrl", "locale", "phoneNumber", "passwordHash", "emailVerified", "metadata", "WorkspaceMember", "RefreshTokens"],
|
||||||
|
PersonUpsertWithWhereUniqueWithoutCompanyInput: ["where", "update", "create"],
|
||||||
|
PersonUpdateWithWhereUniqueWithoutCompanyInput: ["where", "data"],
|
||||||
|
PersonUpdateManyWithWhereWithoutCompanyInput: ["where", "data"],
|
||||||
|
WorkspaceUpsertWithoutCompaniesInput: ["update", "create"],
|
||||||
|
WorkspaceUpdateWithoutCompaniesInput: ["id", "createdAt", "updatedAt", "deletedAt", "domainName", "displayName", "WorkspaceMember", "people"],
|
||||||
|
CompanyCreateWithoutPeopleInput: ["id", "createdAt", "updatedAt", "deletedAt", "name", "domainName", "address", "employees", "accountOwner", "workspace"],
|
||||||
|
CompanyCreateOrConnectWithoutPeopleInput: ["where", "create"],
|
||||||
|
WorkspaceCreateWithoutPeopleInput: ["id", "createdAt", "updatedAt", "deletedAt", "domainName", "displayName", "WorkspaceMember", "companies"],
|
||||||
|
WorkspaceCreateOrConnectWithoutPeopleInput: ["where", "create"],
|
||||||
|
CompanyUpsertWithoutPeopleInput: ["update", "create"],
|
||||||
|
CompanyUpdateWithoutPeopleInput: ["id", "createdAt", "updatedAt", "deletedAt", "name", "domainName", "address", "employees", "accountOwner", "workspace"],
|
||||||
|
WorkspaceUpsertWithoutPeopleInput: ["update", "create"],
|
||||||
|
WorkspaceUpdateWithoutPeopleInput: ["id", "createdAt", "updatedAt", "deletedAt", "domainName", "displayName", "WorkspaceMember", "companies"],
|
||||||
|
UserCreateWithoutRefreshTokensInput: ["id", "createdAt", "updatedAt", "deletedAt", "lastSeen", "disabled", "displayName", "email", "avatarUrl", "locale", "phoneNumber", "passwordHash", "emailVerified", "metadata", "WorkspaceMember", "companies"],
|
||||||
|
UserCreateOrConnectWithoutRefreshTokensInput: ["where", "create"],
|
||||||
|
UserUpsertWithoutRefreshTokensInput: ["update", "create"],
|
||||||
|
UserUpdateWithoutRefreshTokensInput: ["id", "createdAt", "updatedAt", "deletedAt", "lastSeen", "disabled", "displayName", "email", "avatarUrl", "locale", "phoneNumber", "passwordHash", "emailVerified", "metadata", "WorkspaceMember", "companies"],
|
||||||
|
CompanyCreateManyAccountOwnerInput: ["id", "createdAt", "updatedAt", "deletedAt", "name", "domainName", "address", "employees", "workspaceId"],
|
||||||
|
RefreshTokenCreateManyUserInput: ["id", "createdAt", "updatedAt", "deletedAt", "refreshToken"],
|
||||||
|
CompanyUpdateWithoutAccountOwnerInput: ["id", "createdAt", "updatedAt", "deletedAt", "name", "domainName", "address", "employees", "people", "workspace"],
|
||||||
|
RefreshTokenUpdateWithoutUserInput: ["id", "createdAt", "updatedAt", "deletedAt", "refreshToken"],
|
||||||
|
WorkspaceMemberCreateManyWorkspaceInput: ["id", "createdAt", "updatedAt", "deletedAt", "userId"],
|
||||||
|
CompanyCreateManyWorkspaceInput: ["id", "createdAt", "updatedAt", "deletedAt", "name", "domainName", "address", "employees", "accountOwnerId"],
|
||||||
|
PersonCreateManyWorkspaceInput: ["id", "createdAt", "updatedAt", "deletedAt", "firstname", "lastname", "email", "phone", "city", "companyId"],
|
||||||
|
WorkspaceMemberUpdateWithoutWorkspaceInput: ["id", "createdAt", "updatedAt", "deletedAt", "user"],
|
||||||
|
CompanyUpdateWithoutWorkspaceInput: ["id", "createdAt", "updatedAt", "deletedAt", "name", "domainName", "address", "employees", "accountOwner", "people"],
|
||||||
|
PersonUpdateWithoutWorkspaceInput: ["id", "createdAt", "updatedAt", "deletedAt", "firstname", "lastname", "email", "phone", "city", "company"],
|
||||||
|
PersonCreateManyCompanyInput: ["id", "createdAt", "updatedAt", "deletedAt", "firstname", "lastname", "email", "phone", "city", "workspaceId"],
|
||||||
|
PersonUpdateWithoutCompanyInput: ["id", "createdAt", "updatedAt", "deletedAt", "firstname", "lastname", "email", "phone", "city", "workspace"]
|
||||||
|
};
|
||||||
|
|
||||||
|
type InputTypesNames = keyof typeof inputTypes;
|
||||||
|
|
||||||
|
type InputTypeFieldNames<TInput extends InputTypesNames> = Exclude<
|
||||||
|
keyof typeof inputTypes[TInput]["prototype"],
|
||||||
|
number | symbol
|
||||||
|
>;
|
||||||
|
|
||||||
|
type InputTypeFieldsConfig<
|
||||||
|
TInput extends InputTypesNames
|
||||||
|
> = FieldsConfig<InputTypeFieldNames<TInput>>;
|
||||||
|
|
||||||
|
export type InputTypeConfig<TInput extends InputTypesNames> = {
|
||||||
|
class?: ClassDecorator[];
|
||||||
|
fields?: InputTypeFieldsConfig<TInput>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export type InputTypesEnhanceMap = {
|
||||||
|
[TInput in InputTypesNames]?: InputTypeConfig<TInput>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export function applyInputTypesEnhanceMap(
|
||||||
|
inputTypesEnhanceMap: InputTypesEnhanceMap,
|
||||||
|
) {
|
||||||
|
for (const inputTypeEnhanceMapKey of Object.keys(inputTypesEnhanceMap)) {
|
||||||
|
const inputTypeName = inputTypeEnhanceMapKey as keyof typeof inputTypesEnhanceMap;
|
||||||
|
const typeConfig = inputTypesEnhanceMap[inputTypeName]!;
|
||||||
|
const typeClass = inputTypes[inputTypeName];
|
||||||
|
const typeTarget = typeClass.prototype;
|
||||||
|
applyTypeClassEnhanceConfig(
|
||||||
|
typeConfig,
|
||||||
|
typeClass,
|
||||||
|
typeTarget,
|
||||||
|
inputsInfo[inputTypeName as keyof typeof inputsInfo],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
18
server/src/api/local-graphql/enums/CompanyScalarFieldEnum.ts
Normal file
18
server/src/api/local-graphql/enums/CompanyScalarFieldEnum.ts
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
|
||||||
|
export enum CompanyScalarFieldEnum {
|
||||||
|
id = 'id',
|
||||||
|
createdAt = 'createdAt',
|
||||||
|
updatedAt = 'updatedAt',
|
||||||
|
deletedAt = 'deletedAt',
|
||||||
|
name = 'name',
|
||||||
|
domainName = 'domainName',
|
||||||
|
address = 'address',
|
||||||
|
employees = 'employees',
|
||||||
|
accountOwnerId = 'accountOwnerId',
|
||||||
|
workspaceId = 'workspaceId',
|
||||||
|
}
|
||||||
|
TypeGraphQL.registerEnumType(CompanyScalarFieldEnum, {
|
||||||
|
name: 'CompanyScalarFieldEnum',
|
||||||
|
description: undefined,
|
||||||
|
});
|
||||||
11
server/src/api/local-graphql/enums/JsonNullValueFilter.ts
Normal file
11
server/src/api/local-graphql/enums/JsonNullValueFilter.ts
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
|
||||||
|
export enum JsonNullValueFilter {
|
||||||
|
DbNull = 'DbNull',
|
||||||
|
JsonNull = 'JsonNull',
|
||||||
|
AnyNull = 'AnyNull',
|
||||||
|
}
|
||||||
|
TypeGraphQL.registerEnumType(JsonNullValueFilter, {
|
||||||
|
name: 'JsonNullValueFilter',
|
||||||
|
description: undefined,
|
||||||
|
});
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
|
||||||
|
export enum NullableJsonNullValueInput {
|
||||||
|
DbNull = 'DbNull',
|
||||||
|
JsonNull = 'JsonNull',
|
||||||
|
}
|
||||||
|
TypeGraphQL.registerEnumType(NullableJsonNullValueInput, {
|
||||||
|
name: 'NullableJsonNullValueInput',
|
||||||
|
description: undefined,
|
||||||
|
});
|
||||||
19
server/src/api/local-graphql/enums/PersonScalarFieldEnum.ts
Normal file
19
server/src/api/local-graphql/enums/PersonScalarFieldEnum.ts
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
|
||||||
|
export enum PersonScalarFieldEnum {
|
||||||
|
id = 'id',
|
||||||
|
createdAt = 'createdAt',
|
||||||
|
updatedAt = 'updatedAt',
|
||||||
|
deletedAt = 'deletedAt',
|
||||||
|
firstname = 'firstname',
|
||||||
|
lastname = 'lastname',
|
||||||
|
email = 'email',
|
||||||
|
phone = 'phone',
|
||||||
|
city = 'city',
|
||||||
|
companyId = 'companyId',
|
||||||
|
workspaceId = 'workspaceId',
|
||||||
|
}
|
||||||
|
TypeGraphQL.registerEnumType(PersonScalarFieldEnum, {
|
||||||
|
name: 'PersonScalarFieldEnum',
|
||||||
|
description: undefined,
|
||||||
|
});
|
||||||
10
server/src/api/local-graphql/enums/QueryMode.ts
Normal file
10
server/src/api/local-graphql/enums/QueryMode.ts
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
|
||||||
|
export enum QueryMode {
|
||||||
|
'default' = 'default',
|
||||||
|
insensitive = 'insensitive',
|
||||||
|
}
|
||||||
|
TypeGraphQL.registerEnumType(QueryMode, {
|
||||||
|
name: 'QueryMode',
|
||||||
|
description: undefined,
|
||||||
|
});
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
|
||||||
|
export enum RefreshTokenScalarFieldEnum {
|
||||||
|
id = 'id',
|
||||||
|
createdAt = 'createdAt',
|
||||||
|
updatedAt = 'updatedAt',
|
||||||
|
deletedAt = 'deletedAt',
|
||||||
|
refreshToken = 'refreshToken',
|
||||||
|
userId = 'userId',
|
||||||
|
}
|
||||||
|
TypeGraphQL.registerEnumType(RefreshTokenScalarFieldEnum, {
|
||||||
|
name: 'RefreshTokenScalarFieldEnum',
|
||||||
|
description: undefined,
|
||||||
|
});
|
||||||
10
server/src/api/local-graphql/enums/SortOrder.ts
Normal file
10
server/src/api/local-graphql/enums/SortOrder.ts
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
|
||||||
|
export enum SortOrder {
|
||||||
|
asc = 'asc',
|
||||||
|
desc = 'desc',
|
||||||
|
}
|
||||||
|
TypeGraphQL.registerEnumType(SortOrder, {
|
||||||
|
name: 'SortOrder',
|
||||||
|
description: undefined,
|
||||||
|
});
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
|
||||||
|
export enum TransactionIsolationLevel {
|
||||||
|
ReadUncommitted = 'ReadUncommitted',
|
||||||
|
ReadCommitted = 'ReadCommitted',
|
||||||
|
RepeatableRead = 'RepeatableRead',
|
||||||
|
Serializable = 'Serializable',
|
||||||
|
}
|
||||||
|
TypeGraphQL.registerEnumType(TransactionIsolationLevel, {
|
||||||
|
name: 'TransactionIsolationLevel',
|
||||||
|
description: undefined,
|
||||||
|
});
|
||||||
22
server/src/api/local-graphql/enums/UserScalarFieldEnum.ts
Normal file
22
server/src/api/local-graphql/enums/UserScalarFieldEnum.ts
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
|
||||||
|
export enum UserScalarFieldEnum {
|
||||||
|
id = 'id',
|
||||||
|
createdAt = 'createdAt',
|
||||||
|
updatedAt = 'updatedAt',
|
||||||
|
deletedAt = 'deletedAt',
|
||||||
|
lastSeen = 'lastSeen',
|
||||||
|
disabled = 'disabled',
|
||||||
|
displayName = 'displayName',
|
||||||
|
email = 'email',
|
||||||
|
avatarUrl = 'avatarUrl',
|
||||||
|
locale = 'locale',
|
||||||
|
phoneNumber = 'phoneNumber',
|
||||||
|
passwordHash = 'passwordHash',
|
||||||
|
emailVerified = 'emailVerified',
|
||||||
|
metadata = 'metadata',
|
||||||
|
}
|
||||||
|
TypeGraphQL.registerEnumType(UserScalarFieldEnum, {
|
||||||
|
name: 'UserScalarFieldEnum',
|
||||||
|
description: undefined,
|
||||||
|
});
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
|
||||||
|
export enum WorkspaceMemberScalarFieldEnum {
|
||||||
|
id = 'id',
|
||||||
|
createdAt = 'createdAt',
|
||||||
|
updatedAt = 'updatedAt',
|
||||||
|
deletedAt = 'deletedAt',
|
||||||
|
userId = 'userId',
|
||||||
|
workspaceId = 'workspaceId',
|
||||||
|
}
|
||||||
|
TypeGraphQL.registerEnumType(WorkspaceMemberScalarFieldEnum, {
|
||||||
|
name: 'WorkspaceMemberScalarFieldEnum',
|
||||||
|
description: undefined,
|
||||||
|
});
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
|
||||||
|
export enum WorkspaceScalarFieldEnum {
|
||||||
|
id = 'id',
|
||||||
|
createdAt = 'createdAt',
|
||||||
|
updatedAt = 'updatedAt',
|
||||||
|
deletedAt = 'deletedAt',
|
||||||
|
domainName = 'domainName',
|
||||||
|
displayName = 'displayName',
|
||||||
|
}
|
||||||
|
TypeGraphQL.registerEnumType(WorkspaceScalarFieldEnum, {
|
||||||
|
name: 'WorkspaceScalarFieldEnum',
|
||||||
|
description: undefined,
|
||||||
|
});
|
||||||
11
server/src/api/local-graphql/enums/index.ts
Normal file
11
server/src/api/local-graphql/enums/index.ts
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
export { CompanyScalarFieldEnum } from "./CompanyScalarFieldEnum";
|
||||||
|
export { JsonNullValueFilter } from "./JsonNullValueFilter";
|
||||||
|
export { NullableJsonNullValueInput } from "./NullableJsonNullValueInput";
|
||||||
|
export { PersonScalarFieldEnum } from "./PersonScalarFieldEnum";
|
||||||
|
export { QueryMode } from "./QueryMode";
|
||||||
|
export { RefreshTokenScalarFieldEnum } from "./RefreshTokenScalarFieldEnum";
|
||||||
|
export { SortOrder } from "./SortOrder";
|
||||||
|
export { TransactionIsolationLevel } from "./TransactionIsolationLevel";
|
||||||
|
export { UserScalarFieldEnum } from "./UserScalarFieldEnum";
|
||||||
|
export { WorkspaceMemberScalarFieldEnum } from "./WorkspaceMemberScalarFieldEnum";
|
||||||
|
export { WorkspaceScalarFieldEnum } from "./WorkspaceScalarFieldEnum";
|
||||||
63
server/src/api/local-graphql/helpers.ts
Normal file
63
server/src/api/local-graphql/helpers.ts
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
import type { GraphQLResolveInfo } from 'graphql';
|
||||||
|
import graphqlFields from 'graphql-fields';
|
||||||
|
|
||||||
|
export function transformInfoIntoPrismaArgs(
|
||||||
|
info: GraphQLResolveInfo,
|
||||||
|
): Record<string, any> {
|
||||||
|
const fields: Record<string, any> = graphqlFields(
|
||||||
|
// suppress GraphQLResolveInfo types issue
|
||||||
|
info as any,
|
||||||
|
{},
|
||||||
|
{
|
||||||
|
excludedFields: ['__typename'],
|
||||||
|
processArguments: true,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
return transformFields(fields);
|
||||||
|
}
|
||||||
|
|
||||||
|
function transformFields(fields: Record<string, any>): Record<string, any> {
|
||||||
|
return Object.fromEntries(
|
||||||
|
Object.entries(fields).map<[string, any]>(([key, value]) => {
|
||||||
|
if (Object.keys(value).length === 0) {
|
||||||
|
return [key, true];
|
||||||
|
}
|
||||||
|
if ('__arguments' in value) {
|
||||||
|
return [
|
||||||
|
key,
|
||||||
|
Object.fromEntries(
|
||||||
|
value.__arguments.map((argument: object) => {
|
||||||
|
const [[key, { value }]] = Object.entries(argument);
|
||||||
|
return [key, value];
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
return [key, transformFields(value)];
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getPrismaFromContext(context: any) {
|
||||||
|
const prismaClient = context['prisma'];
|
||||||
|
if (!prismaClient) {
|
||||||
|
throw new Error(
|
||||||
|
'Unable to find Prisma Client in GraphQL context. Please provide it under the `context["prisma"]` key.',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return prismaClient;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function transformCountFieldIntoSelectRelationsCount(_count: object) {
|
||||||
|
return {
|
||||||
|
include: {
|
||||||
|
_count: {
|
||||||
|
select: {
|
||||||
|
...Object.fromEntries(
|
||||||
|
Object.entries(_count).filter(([_, v]) => v != null),
|
||||||
|
),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
23
server/src/api/local-graphql/index.ts
Normal file
23
server/src/api/local-graphql/index.ts
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
import * as crudResolversImport from "./resolvers/crud/resolvers-crud.index";
|
||||||
|
import * as relationResolversImport from "./resolvers/relations/resolvers.index";
|
||||||
|
import { NonEmptyArray } from "type-graphql";
|
||||||
|
|
||||||
|
export * from "./enums";
|
||||||
|
export * from "./models";
|
||||||
|
export * from "./resolvers/crud";
|
||||||
|
|
||||||
|
export const crudResolvers = Object.values(crudResolversImport) as unknown as NonEmptyArray<Function>;
|
||||||
|
|
||||||
|
export * from "./resolvers/relations";
|
||||||
|
|
||||||
|
export const relationResolvers = Object.values(relationResolversImport) as unknown as NonEmptyArray<Function>;
|
||||||
|
|
||||||
|
export * from "./resolvers/inputs";
|
||||||
|
export * from "./resolvers/outputs";
|
||||||
|
export * from "./enhance";
|
||||||
|
export * from "./scalars";
|
||||||
|
|
||||||
|
export const resolvers = [
|
||||||
|
...crudResolvers,
|
||||||
|
...relationResolvers,
|
||||||
|
] as unknown as NonEmptyArray<Function>;
|
||||||
74
server/src/api/local-graphql/models/Company.ts
Normal file
74
server/src/api/local-graphql/models/Company.ts
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
import * as GraphQLScalars from 'graphql-scalars';
|
||||||
|
import { Prisma } from '@prisma/client';
|
||||||
|
import { DecimalJSScalar } from '../scalars';
|
||||||
|
import { Person } from './Person';
|
||||||
|
import { User } from './User';
|
||||||
|
import { Workspace } from './Workspace';
|
||||||
|
import { CompanyCount } from '../resolvers/outputs/CompanyCount';
|
||||||
|
|
||||||
|
@TypeGraphQL.ObjectType('Company', {
|
||||||
|
isAbstract: true,
|
||||||
|
})
|
||||||
|
export class Company {
|
||||||
|
@TypeGraphQL.Field((_type) => String, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
id!: string;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => Date, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
createdAt!: Date;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => Date, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
updatedAt!: Date;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => Date, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
deletedAt?: Date | null;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => String, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
name!: string;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => String, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
domainName!: string;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => String, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
address!: string;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => TypeGraphQL.Int, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
employees?: number | null;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => String, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
accountOwnerId?: string | null;
|
||||||
|
|
||||||
|
accountOwner?: User | null;
|
||||||
|
|
||||||
|
people?: Person[];
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => String, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
workspaceId!: string;
|
||||||
|
|
||||||
|
workspace?: Workspace;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => CompanyCount, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
_count?: CompanyCount | null;
|
||||||
|
}
|
||||||
70
server/src/api/local-graphql/models/Person.ts
Normal file
70
server/src/api/local-graphql/models/Person.ts
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
import * as GraphQLScalars from 'graphql-scalars';
|
||||||
|
import { Prisma } from '@prisma/client';
|
||||||
|
import { DecimalJSScalar } from '../scalars';
|
||||||
|
import { Company } from './Company';
|
||||||
|
import { Workspace } from './Workspace';
|
||||||
|
|
||||||
|
@TypeGraphQL.ObjectType('Person', {
|
||||||
|
isAbstract: true,
|
||||||
|
})
|
||||||
|
export class Person {
|
||||||
|
@TypeGraphQL.Field((_type) => String, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
id!: string;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => Date, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
createdAt!: Date;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => Date, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
updatedAt!: Date;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => Date, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
deletedAt?: Date | null;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => String, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
firstname!: string;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => String, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
lastname!: string;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => String, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
email!: string;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => String, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
phone!: string;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => String, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
city!: string;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => String, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
companyId?: string | null;
|
||||||
|
|
||||||
|
company?: Company | null;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => String, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
workspaceId!: string;
|
||||||
|
|
||||||
|
workspace?: Workspace;
|
||||||
|
}
|
||||||
42
server/src/api/local-graphql/models/RefreshToken.ts
Normal file
42
server/src/api/local-graphql/models/RefreshToken.ts
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
import * as GraphQLScalars from 'graphql-scalars';
|
||||||
|
import { Prisma } from '@prisma/client';
|
||||||
|
import { DecimalJSScalar } from '../scalars';
|
||||||
|
import { User } from './User';
|
||||||
|
|
||||||
|
@TypeGraphQL.ObjectType('RefreshToken', {
|
||||||
|
isAbstract: true,
|
||||||
|
})
|
||||||
|
export class RefreshToken {
|
||||||
|
@TypeGraphQL.Field((_type) => String, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
id!: string;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => Date, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
createdAt!: Date;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => Date, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
updatedAt!: Date;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => Date, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
deletedAt?: Date | null;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => String, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
refreshToken!: string;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => String, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
userId!: string;
|
||||||
|
|
||||||
|
user?: User;
|
||||||
|
}
|
||||||
94
server/src/api/local-graphql/models/User.ts
Normal file
94
server/src/api/local-graphql/models/User.ts
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
import * as GraphQLScalars from 'graphql-scalars';
|
||||||
|
import { Prisma } from '@prisma/client';
|
||||||
|
import { DecimalJSScalar } from '../scalars';
|
||||||
|
import { Company } from './Company';
|
||||||
|
import { RefreshToken } from './RefreshToken';
|
||||||
|
import { WorkspaceMember } from './WorkspaceMember';
|
||||||
|
import { UserCount } from '../resolvers/outputs/UserCount';
|
||||||
|
|
||||||
|
@TypeGraphQL.ObjectType('User', {
|
||||||
|
isAbstract: true,
|
||||||
|
})
|
||||||
|
export class User {
|
||||||
|
@TypeGraphQL.Field((_type) => String, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
id!: string;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => Date, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
createdAt!: Date;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => Date, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
updatedAt!: Date;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => Date, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
deletedAt?: Date | null;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => Date, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
lastSeen?: Date | null;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => Boolean, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
disabled!: boolean;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => String, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
displayName!: string;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => String, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
email!: string;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => String, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
avatarUrl?: string | null;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => String, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
locale!: string;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => String, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
phoneNumber?: string | null;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => String, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
passwordHash?: string | null;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => Boolean, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
emailVerified!: boolean;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => GraphQLScalars.JSONResolver, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
metadata?: Prisma.JsonValue | null;
|
||||||
|
|
||||||
|
WorkspaceMember?: WorkspaceMember | null;
|
||||||
|
|
||||||
|
companies?: Company[];
|
||||||
|
|
||||||
|
RefreshTokens?: RefreshToken[];
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => UserCount, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
_count?: UserCount | null;
|
||||||
|
}
|
||||||
54
server/src/api/local-graphql/models/Workspace.ts
Normal file
54
server/src/api/local-graphql/models/Workspace.ts
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
import * as GraphQLScalars from 'graphql-scalars';
|
||||||
|
import { Prisma } from '@prisma/client';
|
||||||
|
import { DecimalJSScalar } from '../scalars';
|
||||||
|
import { Company } from './Company';
|
||||||
|
import { Person } from './Person';
|
||||||
|
import { WorkspaceMember } from './WorkspaceMember';
|
||||||
|
import { WorkspaceCount } from '../resolvers/outputs/WorkspaceCount';
|
||||||
|
|
||||||
|
@TypeGraphQL.ObjectType('Workspace', {
|
||||||
|
isAbstract: true,
|
||||||
|
})
|
||||||
|
export class Workspace {
|
||||||
|
@TypeGraphQL.Field((_type) => String, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
id!: string;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => Date, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
createdAt!: Date;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => Date, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
updatedAt!: Date;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => Date, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
deletedAt?: Date | null;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => String, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
domainName!: string;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => String, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
displayName!: string;
|
||||||
|
|
||||||
|
WorkspaceMember?: WorkspaceMember[];
|
||||||
|
|
||||||
|
companies?: Company[];
|
||||||
|
|
||||||
|
people?: Person[];
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => WorkspaceCount, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
_count?: WorkspaceCount | null;
|
||||||
|
}
|
||||||
45
server/src/api/local-graphql/models/WorkspaceMember.ts
Normal file
45
server/src/api/local-graphql/models/WorkspaceMember.ts
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
import * as GraphQLScalars from 'graphql-scalars';
|
||||||
|
import { Prisma } from '@prisma/client';
|
||||||
|
import { DecimalJSScalar } from '../scalars';
|
||||||
|
import { User } from './User';
|
||||||
|
import { Workspace } from './Workspace';
|
||||||
|
|
||||||
|
@TypeGraphQL.ObjectType('WorkspaceMember', {
|
||||||
|
isAbstract: true,
|
||||||
|
})
|
||||||
|
export class WorkspaceMember {
|
||||||
|
@TypeGraphQL.Field((_type) => String, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
id!: string;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => Date, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
createdAt!: Date;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => Date, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
updatedAt!: Date;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => Date, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
deletedAt?: Date | null;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => String, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
userId!: string;
|
||||||
|
|
||||||
|
user?: User;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => String, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
workspaceId!: string;
|
||||||
|
|
||||||
|
workspace?: Workspace;
|
||||||
|
}
|
||||||
6
server/src/api/local-graphql/models/index.ts
Normal file
6
server/src/api/local-graphql/models/index.ts
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
export { Company } from "./Company";
|
||||||
|
export { Person } from "./Person";
|
||||||
|
export { RefreshToken } from "./RefreshToken";
|
||||||
|
export { User } from "./User";
|
||||||
|
export { Workspace } from "./Workspace";
|
||||||
|
export { WorkspaceMember } from "./WorkspaceMember";
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
import * as TypeGraphQL from "type-graphql";
|
||||||
|
import type { GraphQLResolveInfo } from "graphql";
|
||||||
|
import { AggregateCompanyArgs } from "./args/AggregateCompanyArgs";
|
||||||
|
import { Company } from "../../../models/Company";
|
||||||
|
import { AggregateCompany } from "../../outputs/AggregateCompany";
|
||||||
|
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||||
|
|
||||||
|
@TypeGraphQL.Resolver(_of => Company)
|
||||||
|
export class AggregateCompanyResolver {
|
||||||
|
@TypeGraphQL.Query(_returns => AggregateCompany, {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async aggregateCompany(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: AggregateCompanyArgs): Promise<AggregateCompany> {
|
||||||
|
return getPrismaFromContext(ctx).company.aggregate({
|
||||||
|
...args,
|
||||||
|
...transformInfoIntoPrismaArgs(info),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,179 @@
|
|||||||
|
import * as TypeGraphQL from "type-graphql";
|
||||||
|
import type { GraphQLResolveInfo } from "graphql";
|
||||||
|
import { AggregateCompanyArgs } from "./args/AggregateCompanyArgs";
|
||||||
|
import { CreateManyCompanyArgs } from "./args/CreateManyCompanyArgs";
|
||||||
|
import { CreateOneCompanyArgs } from "./args/CreateOneCompanyArgs";
|
||||||
|
import { DeleteManyCompanyArgs } from "./args/DeleteManyCompanyArgs";
|
||||||
|
import { DeleteOneCompanyArgs } from "./args/DeleteOneCompanyArgs";
|
||||||
|
import { FindFirstCompanyArgs } from "./args/FindFirstCompanyArgs";
|
||||||
|
import { FindFirstCompanyOrThrowArgs } from "./args/FindFirstCompanyOrThrowArgs";
|
||||||
|
import { FindManyCompanyArgs } from "./args/FindManyCompanyArgs";
|
||||||
|
import { FindUniqueCompanyArgs } from "./args/FindUniqueCompanyArgs";
|
||||||
|
import { FindUniqueCompanyOrThrowArgs } from "./args/FindUniqueCompanyOrThrowArgs";
|
||||||
|
import { GroupByCompanyArgs } from "./args/GroupByCompanyArgs";
|
||||||
|
import { UpdateManyCompanyArgs } from "./args/UpdateManyCompanyArgs";
|
||||||
|
import { UpdateOneCompanyArgs } from "./args/UpdateOneCompanyArgs";
|
||||||
|
import { UpsertOneCompanyArgs } from "./args/UpsertOneCompanyArgs";
|
||||||
|
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||||
|
import { Company } from "../../../models/Company";
|
||||||
|
import { AffectedRowsOutput } from "../../outputs/AffectedRowsOutput";
|
||||||
|
import { AggregateCompany } from "../../outputs/AggregateCompany";
|
||||||
|
import { CompanyGroupBy } from "../../outputs/CompanyGroupBy";
|
||||||
|
|
||||||
|
@TypeGraphQL.Resolver(_of => Company)
|
||||||
|
export class CompanyCrudResolver {
|
||||||
|
@TypeGraphQL.Query(_returns => AggregateCompany, {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async aggregateCompany(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: AggregateCompanyArgs): Promise<AggregateCompany> {
|
||||||
|
return getPrismaFromContext(ctx).company.aggregate({
|
||||||
|
...args,
|
||||||
|
...transformInfoIntoPrismaArgs(info),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@TypeGraphQL.Mutation(_returns => AffectedRowsOutput, {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async createManyCompany(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: CreateManyCompanyArgs): Promise<AffectedRowsOutput> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).company.createMany({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@TypeGraphQL.Mutation(_returns => Company, {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async createOneCompany(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: CreateOneCompanyArgs): Promise<Company> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).company.create({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@TypeGraphQL.Mutation(_returns => AffectedRowsOutput, {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async deleteManyCompany(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: DeleteManyCompanyArgs): Promise<AffectedRowsOutput> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).company.deleteMany({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@TypeGraphQL.Mutation(_returns => Company, {
|
||||||
|
nullable: true
|
||||||
|
})
|
||||||
|
async deleteOneCompany(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: DeleteOneCompanyArgs): Promise<Company | null> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).company.delete({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@TypeGraphQL.Query(_returns => Company, {
|
||||||
|
nullable: true
|
||||||
|
})
|
||||||
|
async findFirstCompany(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: FindFirstCompanyArgs): Promise<Company | null> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).company.findFirst({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@TypeGraphQL.Query(_returns => Company, {
|
||||||
|
nullable: true
|
||||||
|
})
|
||||||
|
async findFirstCompanyOrThrow(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: FindFirstCompanyOrThrowArgs): Promise<Company | null> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).company.findFirstOrThrow({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@TypeGraphQL.Query(_returns => [Company], {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async companies(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: FindManyCompanyArgs): Promise<Company[]> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).company.findMany({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@TypeGraphQL.Query(_returns => Company, {
|
||||||
|
nullable: true
|
||||||
|
})
|
||||||
|
async company(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: FindUniqueCompanyArgs): Promise<Company | null> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).company.findUnique({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@TypeGraphQL.Query(_returns => Company, {
|
||||||
|
nullable: true
|
||||||
|
})
|
||||||
|
async getCompany(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: FindUniqueCompanyOrThrowArgs): Promise<Company | null> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).company.findUniqueOrThrow({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@TypeGraphQL.Query(_returns => [CompanyGroupBy], {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async groupByCompany(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: GroupByCompanyArgs): Promise<CompanyGroupBy[]> {
|
||||||
|
const { _count, _avg, _sum, _min, _max } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).company.groupBy({
|
||||||
|
...args,
|
||||||
|
...Object.fromEntries(
|
||||||
|
Object.entries({ _count, _avg, _sum, _min, _max }).filter(([_, v]) => v != null)
|
||||||
|
),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@TypeGraphQL.Mutation(_returns => AffectedRowsOutput, {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async updateManyCompany(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: UpdateManyCompanyArgs): Promise<AffectedRowsOutput> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).company.updateMany({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@TypeGraphQL.Mutation(_returns => Company, {
|
||||||
|
nullable: true
|
||||||
|
})
|
||||||
|
async updateOneCompany(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: UpdateOneCompanyArgs): Promise<Company | null> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).company.update({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@TypeGraphQL.Mutation(_returns => Company, {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async upsertOneCompany(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: UpsertOneCompanyArgs): Promise<Company> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).company.upsert({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,20 @@
|
|||||||
|
import * as TypeGraphQL from "type-graphql";
|
||||||
|
import type { GraphQLResolveInfo } from "graphql";
|
||||||
|
import { CreateManyCompanyArgs } from "./args/CreateManyCompanyArgs";
|
||||||
|
import { Company } from "../../../models/Company";
|
||||||
|
import { AffectedRowsOutput } from "../../outputs/AffectedRowsOutput";
|
||||||
|
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||||
|
|
||||||
|
@TypeGraphQL.Resolver(_of => Company)
|
||||||
|
export class CreateManyCompanyResolver {
|
||||||
|
@TypeGraphQL.Mutation(_returns => AffectedRowsOutput, {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async createManyCompany(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: CreateManyCompanyArgs): Promise<AffectedRowsOutput> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).company.createMany({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
import * as TypeGraphQL from "type-graphql";
|
||||||
|
import type { GraphQLResolveInfo } from "graphql";
|
||||||
|
import { CreateOneCompanyArgs } from "./args/CreateOneCompanyArgs";
|
||||||
|
import { Company } from "../../../models/Company";
|
||||||
|
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||||
|
|
||||||
|
@TypeGraphQL.Resolver(_of => Company)
|
||||||
|
export class CreateOneCompanyResolver {
|
||||||
|
@TypeGraphQL.Mutation(_returns => Company, {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async createOneCompany(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: CreateOneCompanyArgs): Promise<Company> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).company.create({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,20 @@
|
|||||||
|
import * as TypeGraphQL from "type-graphql";
|
||||||
|
import type { GraphQLResolveInfo } from "graphql";
|
||||||
|
import { DeleteManyCompanyArgs } from "./args/DeleteManyCompanyArgs";
|
||||||
|
import { Company } from "../../../models/Company";
|
||||||
|
import { AffectedRowsOutput } from "../../outputs/AffectedRowsOutput";
|
||||||
|
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||||
|
|
||||||
|
@TypeGraphQL.Resolver(_of => Company)
|
||||||
|
export class DeleteManyCompanyResolver {
|
||||||
|
@TypeGraphQL.Mutation(_returns => AffectedRowsOutput, {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async deleteManyCompany(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: DeleteManyCompanyArgs): Promise<AffectedRowsOutput> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).company.deleteMany({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
import * as TypeGraphQL from "type-graphql";
|
||||||
|
import type { GraphQLResolveInfo } from "graphql";
|
||||||
|
import { DeleteOneCompanyArgs } from "./args/DeleteOneCompanyArgs";
|
||||||
|
import { Company } from "../../../models/Company";
|
||||||
|
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||||
|
|
||||||
|
@TypeGraphQL.Resolver(_of => Company)
|
||||||
|
export class DeleteOneCompanyResolver {
|
||||||
|
@TypeGraphQL.Mutation(_returns => Company, {
|
||||||
|
nullable: true
|
||||||
|
})
|
||||||
|
async deleteOneCompany(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: DeleteOneCompanyArgs): Promise<Company | null> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).company.delete({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
import * as TypeGraphQL from "type-graphql";
|
||||||
|
import type { GraphQLResolveInfo } from "graphql";
|
||||||
|
import { FindFirstCompanyOrThrowArgs } from "./args/FindFirstCompanyOrThrowArgs";
|
||||||
|
import { Company } from "../../../models/Company";
|
||||||
|
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||||
|
|
||||||
|
@TypeGraphQL.Resolver(_of => Company)
|
||||||
|
export class FindFirstCompanyOrThrowResolver {
|
||||||
|
@TypeGraphQL.Query(_returns => Company, {
|
||||||
|
nullable: true
|
||||||
|
})
|
||||||
|
async findFirstCompanyOrThrow(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: FindFirstCompanyOrThrowArgs): Promise<Company | null> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).company.findFirstOrThrow({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
import * as TypeGraphQL from "type-graphql";
|
||||||
|
import type { GraphQLResolveInfo } from "graphql";
|
||||||
|
import { FindFirstCompanyArgs } from "./args/FindFirstCompanyArgs";
|
||||||
|
import { Company } from "../../../models/Company";
|
||||||
|
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||||
|
|
||||||
|
@TypeGraphQL.Resolver(_of => Company)
|
||||||
|
export class FindFirstCompanyResolver {
|
||||||
|
@TypeGraphQL.Query(_returns => Company, {
|
||||||
|
nullable: true
|
||||||
|
})
|
||||||
|
async findFirstCompany(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: FindFirstCompanyArgs): Promise<Company | null> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).company.findFirst({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
import * as TypeGraphQL from "type-graphql";
|
||||||
|
import type { GraphQLResolveInfo } from "graphql";
|
||||||
|
import { FindManyCompanyArgs } from "./args/FindManyCompanyArgs";
|
||||||
|
import { Company } from "../../../models/Company";
|
||||||
|
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||||
|
|
||||||
|
@TypeGraphQL.Resolver(_of => Company)
|
||||||
|
export class FindManyCompanyResolver {
|
||||||
|
@TypeGraphQL.Query(_returns => [Company], {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async companies(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: FindManyCompanyArgs): Promise<Company[]> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).company.findMany({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
import * as TypeGraphQL from "type-graphql";
|
||||||
|
import type { GraphQLResolveInfo } from "graphql";
|
||||||
|
import { FindUniqueCompanyOrThrowArgs } from "./args/FindUniqueCompanyOrThrowArgs";
|
||||||
|
import { Company } from "../../../models/Company";
|
||||||
|
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||||
|
|
||||||
|
@TypeGraphQL.Resolver(_of => Company)
|
||||||
|
export class FindUniqueCompanyOrThrowResolver {
|
||||||
|
@TypeGraphQL.Query(_returns => Company, {
|
||||||
|
nullable: true
|
||||||
|
})
|
||||||
|
async getCompany(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: FindUniqueCompanyOrThrowArgs): Promise<Company | null> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).company.findUniqueOrThrow({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
import * as TypeGraphQL from "type-graphql";
|
||||||
|
import type { GraphQLResolveInfo } from "graphql";
|
||||||
|
import { FindUniqueCompanyArgs } from "./args/FindUniqueCompanyArgs";
|
||||||
|
import { Company } from "../../../models/Company";
|
||||||
|
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||||
|
|
||||||
|
@TypeGraphQL.Resolver(_of => Company)
|
||||||
|
export class FindUniqueCompanyResolver {
|
||||||
|
@TypeGraphQL.Query(_returns => Company, {
|
||||||
|
nullable: true
|
||||||
|
})
|
||||||
|
async company(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: FindUniqueCompanyArgs): Promise<Company | null> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).company.findUnique({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,22 @@
|
|||||||
|
import * as TypeGraphQL from "type-graphql";
|
||||||
|
import type { GraphQLResolveInfo } from "graphql";
|
||||||
|
import { GroupByCompanyArgs } from "./args/GroupByCompanyArgs";
|
||||||
|
import { Company } from "../../../models/Company";
|
||||||
|
import { CompanyGroupBy } from "../../outputs/CompanyGroupBy";
|
||||||
|
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||||
|
|
||||||
|
@TypeGraphQL.Resolver(_of => Company)
|
||||||
|
export class GroupByCompanyResolver {
|
||||||
|
@TypeGraphQL.Query(_returns => [CompanyGroupBy], {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async groupByCompany(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: GroupByCompanyArgs): Promise<CompanyGroupBy[]> {
|
||||||
|
const { _count, _avg, _sum, _min, _max } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).company.groupBy({
|
||||||
|
...args,
|
||||||
|
...Object.fromEntries(
|
||||||
|
Object.entries({ _count, _avg, _sum, _min, _max }).filter(([_, v]) => v != null)
|
||||||
|
),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,20 @@
|
|||||||
|
import * as TypeGraphQL from "type-graphql";
|
||||||
|
import type { GraphQLResolveInfo } from "graphql";
|
||||||
|
import { UpdateManyCompanyArgs } from "./args/UpdateManyCompanyArgs";
|
||||||
|
import { Company } from "../../../models/Company";
|
||||||
|
import { AffectedRowsOutput } from "../../outputs/AffectedRowsOutput";
|
||||||
|
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||||
|
|
||||||
|
@TypeGraphQL.Resolver(_of => Company)
|
||||||
|
export class UpdateManyCompanyResolver {
|
||||||
|
@TypeGraphQL.Mutation(_returns => AffectedRowsOutput, {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async updateManyCompany(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: UpdateManyCompanyArgs): Promise<AffectedRowsOutput> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).company.updateMany({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
import * as TypeGraphQL from "type-graphql";
|
||||||
|
import type { GraphQLResolveInfo } from "graphql";
|
||||||
|
import { UpdateOneCompanyArgs } from "./args/UpdateOneCompanyArgs";
|
||||||
|
import { Company } from "../../../models/Company";
|
||||||
|
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||||
|
|
||||||
|
@TypeGraphQL.Resolver(_of => Company)
|
||||||
|
export class UpdateOneCompanyResolver {
|
||||||
|
@TypeGraphQL.Mutation(_returns => Company, {
|
||||||
|
nullable: true
|
||||||
|
})
|
||||||
|
async updateOneCompany(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: UpdateOneCompanyArgs): Promise<Company | null> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).company.update({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
import * as TypeGraphQL from "type-graphql";
|
||||||
|
import type { GraphQLResolveInfo } from "graphql";
|
||||||
|
import { UpsertOneCompanyArgs } from "./args/UpsertOneCompanyArgs";
|
||||||
|
import { Company } from "../../../models/Company";
|
||||||
|
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||||
|
|
||||||
|
@TypeGraphQL.Resolver(_of => Company)
|
||||||
|
export class UpsertOneCompanyResolver {
|
||||||
|
@TypeGraphQL.Mutation(_returns => Company, {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async upsertOneCompany(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: UpsertOneCompanyArgs): Promise<Company> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).company.upsert({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,33 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
import * as GraphQLScalars from 'graphql-scalars';
|
||||||
|
import { CompanyOrderByWithRelationInput } from '../../../inputs/CompanyOrderByWithRelationInput';
|
||||||
|
import { CompanyWhereInput } from '../../../inputs/CompanyWhereInput';
|
||||||
|
import { CompanyWhereUniqueInput } from '../../../inputs/CompanyWhereUniqueInput';
|
||||||
|
|
||||||
|
@TypeGraphQL.ArgsType()
|
||||||
|
export class AggregateCompanyArgs {
|
||||||
|
@TypeGraphQL.Field((_type) => CompanyWhereInput, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
where?: CompanyWhereInput | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => [CompanyOrderByWithRelationInput], {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
orderBy?: CompanyOrderByWithRelationInput[] | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => CompanyWhereUniqueInput, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
cursor?: CompanyWhereUniqueInput | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => TypeGraphQL.Int, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
take?: number | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => TypeGraphQL.Int, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
skip?: number | undefined;
|
||||||
|
}
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
import * as GraphQLScalars from 'graphql-scalars';
|
||||||
|
import { CompanyCreateManyInput } from '../../../inputs/CompanyCreateManyInput';
|
||||||
|
|
||||||
|
@TypeGraphQL.ArgsType()
|
||||||
|
export class CreateManyCompanyArgs {
|
||||||
|
@TypeGraphQL.Field((_type) => [CompanyCreateManyInput], {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
data!: CompanyCreateManyInput[];
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => Boolean, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
skipDuplicates?: boolean | undefined;
|
||||||
|
}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
import * as GraphQLScalars from 'graphql-scalars';
|
||||||
|
import { CompanyCreateInput } from '../../../inputs/CompanyCreateInput';
|
||||||
|
|
||||||
|
@TypeGraphQL.ArgsType()
|
||||||
|
export class CreateOneCompanyArgs {
|
||||||
|
@TypeGraphQL.Field((_type) => CompanyCreateInput, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
data!: CompanyCreateInput;
|
||||||
|
}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
import * as GraphQLScalars from 'graphql-scalars';
|
||||||
|
import { CompanyWhereInput } from '../../../inputs/CompanyWhereInput';
|
||||||
|
|
||||||
|
@TypeGraphQL.ArgsType()
|
||||||
|
export class DeleteManyCompanyArgs {
|
||||||
|
@TypeGraphQL.Field((_type) => CompanyWhereInput, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
where?: CompanyWhereInput | undefined;
|
||||||
|
}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
import * as GraphQLScalars from 'graphql-scalars';
|
||||||
|
import { CompanyWhereUniqueInput } from '../../../inputs/CompanyWhereUniqueInput';
|
||||||
|
|
||||||
|
@TypeGraphQL.ArgsType()
|
||||||
|
export class DeleteOneCompanyArgs {
|
||||||
|
@TypeGraphQL.Field((_type) => CompanyWhereUniqueInput, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
where!: CompanyWhereUniqueInput;
|
||||||
|
}
|
||||||
@ -0,0 +1,52 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
import * as GraphQLScalars from 'graphql-scalars';
|
||||||
|
import { CompanyOrderByWithRelationInput } from '../../../inputs/CompanyOrderByWithRelationInput';
|
||||||
|
import { CompanyWhereInput } from '../../../inputs/CompanyWhereInput';
|
||||||
|
import { CompanyWhereUniqueInput } from '../../../inputs/CompanyWhereUniqueInput';
|
||||||
|
import { CompanyScalarFieldEnum } from '../../../../enums/CompanyScalarFieldEnum';
|
||||||
|
|
||||||
|
@TypeGraphQL.ArgsType()
|
||||||
|
export class FindFirstCompanyArgs {
|
||||||
|
@TypeGraphQL.Field((_type) => CompanyWhereInput, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
where?: CompanyWhereInput | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => [CompanyOrderByWithRelationInput], {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
orderBy?: CompanyOrderByWithRelationInput[] | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => CompanyWhereUniqueInput, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
cursor?: CompanyWhereUniqueInput | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => TypeGraphQL.Int, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
take?: number | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => TypeGraphQL.Int, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
skip?: number | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => [CompanyScalarFieldEnum], {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
distinct?:
|
||||||
|
| Array<
|
||||||
|
| 'id'
|
||||||
|
| 'createdAt'
|
||||||
|
| 'updatedAt'
|
||||||
|
| 'deletedAt'
|
||||||
|
| 'name'
|
||||||
|
| 'domainName'
|
||||||
|
| 'address'
|
||||||
|
| 'employees'
|
||||||
|
| 'accountOwnerId'
|
||||||
|
| 'workspaceId'
|
||||||
|
>
|
||||||
|
| undefined;
|
||||||
|
}
|
||||||
@ -0,0 +1,52 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
import * as GraphQLScalars from 'graphql-scalars';
|
||||||
|
import { CompanyOrderByWithRelationInput } from '../../../inputs/CompanyOrderByWithRelationInput';
|
||||||
|
import { CompanyWhereInput } from '../../../inputs/CompanyWhereInput';
|
||||||
|
import { CompanyWhereUniqueInput } from '../../../inputs/CompanyWhereUniqueInput';
|
||||||
|
import { CompanyScalarFieldEnum } from '../../../../enums/CompanyScalarFieldEnum';
|
||||||
|
|
||||||
|
@TypeGraphQL.ArgsType()
|
||||||
|
export class FindFirstCompanyOrThrowArgs {
|
||||||
|
@TypeGraphQL.Field((_type) => CompanyWhereInput, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
where?: CompanyWhereInput | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => [CompanyOrderByWithRelationInput], {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
orderBy?: CompanyOrderByWithRelationInput[] | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => CompanyWhereUniqueInput, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
cursor?: CompanyWhereUniqueInput | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => TypeGraphQL.Int, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
take?: number | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => TypeGraphQL.Int, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
skip?: number | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => [CompanyScalarFieldEnum], {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
distinct?:
|
||||||
|
| Array<
|
||||||
|
| 'id'
|
||||||
|
| 'createdAt'
|
||||||
|
| 'updatedAt'
|
||||||
|
| 'deletedAt'
|
||||||
|
| 'name'
|
||||||
|
| 'domainName'
|
||||||
|
| 'address'
|
||||||
|
| 'employees'
|
||||||
|
| 'accountOwnerId'
|
||||||
|
| 'workspaceId'
|
||||||
|
>
|
||||||
|
| undefined;
|
||||||
|
}
|
||||||
@ -0,0 +1,52 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
import * as GraphQLScalars from 'graphql-scalars';
|
||||||
|
import { CompanyOrderByWithRelationInput } from '../../../inputs/CompanyOrderByWithRelationInput';
|
||||||
|
import { CompanyWhereInput } from '../../../inputs/CompanyWhereInput';
|
||||||
|
import { CompanyWhereUniqueInput } from '../../../inputs/CompanyWhereUniqueInput';
|
||||||
|
import { CompanyScalarFieldEnum } from '../../../../enums/CompanyScalarFieldEnum';
|
||||||
|
|
||||||
|
@TypeGraphQL.ArgsType()
|
||||||
|
export class FindManyCompanyArgs {
|
||||||
|
@TypeGraphQL.Field((_type) => CompanyWhereInput, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
where?: CompanyWhereInput | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => [CompanyOrderByWithRelationInput], {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
orderBy?: CompanyOrderByWithRelationInput[] | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => CompanyWhereUniqueInput, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
cursor?: CompanyWhereUniqueInput | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => TypeGraphQL.Int, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
take?: number | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => TypeGraphQL.Int, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
skip?: number | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => [CompanyScalarFieldEnum], {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
distinct?:
|
||||||
|
| Array<
|
||||||
|
| 'id'
|
||||||
|
| 'createdAt'
|
||||||
|
| 'updatedAt'
|
||||||
|
| 'deletedAt'
|
||||||
|
| 'name'
|
||||||
|
| 'domainName'
|
||||||
|
| 'address'
|
||||||
|
| 'employees'
|
||||||
|
| 'accountOwnerId'
|
||||||
|
| 'workspaceId'
|
||||||
|
>
|
||||||
|
| undefined;
|
||||||
|
}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
import * as GraphQLScalars from 'graphql-scalars';
|
||||||
|
import { CompanyWhereUniqueInput } from '../../../inputs/CompanyWhereUniqueInput';
|
||||||
|
|
||||||
|
@TypeGraphQL.ArgsType()
|
||||||
|
export class FindUniqueCompanyArgs {
|
||||||
|
@TypeGraphQL.Field((_type) => CompanyWhereUniqueInput, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
where!: CompanyWhereUniqueInput;
|
||||||
|
}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
import * as GraphQLScalars from 'graphql-scalars';
|
||||||
|
import { CompanyWhereUniqueInput } from '../../../inputs/CompanyWhereUniqueInput';
|
||||||
|
|
||||||
|
@TypeGraphQL.ArgsType()
|
||||||
|
export class FindUniqueCompanyOrThrowArgs {
|
||||||
|
@TypeGraphQL.Field((_type) => CompanyWhereUniqueInput, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
where!: CompanyWhereUniqueInput;
|
||||||
|
}
|
||||||
@ -0,0 +1,50 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
import * as GraphQLScalars from 'graphql-scalars';
|
||||||
|
import { CompanyOrderByWithAggregationInput } from '../../../inputs/CompanyOrderByWithAggregationInput';
|
||||||
|
import { CompanyScalarWhereWithAggregatesInput } from '../../../inputs/CompanyScalarWhereWithAggregatesInput';
|
||||||
|
import { CompanyWhereInput } from '../../../inputs/CompanyWhereInput';
|
||||||
|
import { CompanyScalarFieldEnum } from '../../../../enums/CompanyScalarFieldEnum';
|
||||||
|
|
||||||
|
@TypeGraphQL.ArgsType()
|
||||||
|
export class GroupByCompanyArgs {
|
||||||
|
@TypeGraphQL.Field((_type) => CompanyWhereInput, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
where?: CompanyWhereInput | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => [CompanyOrderByWithAggregationInput], {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
orderBy?: CompanyOrderByWithAggregationInput[] | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => [CompanyScalarFieldEnum], {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
by!: Array<
|
||||||
|
| 'id'
|
||||||
|
| 'createdAt'
|
||||||
|
| 'updatedAt'
|
||||||
|
| 'deletedAt'
|
||||||
|
| 'name'
|
||||||
|
| 'domainName'
|
||||||
|
| 'address'
|
||||||
|
| 'employees'
|
||||||
|
| 'accountOwnerId'
|
||||||
|
| 'workspaceId'
|
||||||
|
>;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => CompanyScalarWhereWithAggregatesInput, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
having?: CompanyScalarWhereWithAggregatesInput | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => TypeGraphQL.Int, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
take?: number | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => TypeGraphQL.Int, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
skip?: number | undefined;
|
||||||
|
}
|
||||||
@ -0,0 +1,17 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
import * as GraphQLScalars from 'graphql-scalars';
|
||||||
|
import { CompanyUpdateManyMutationInput } from '../../../inputs/CompanyUpdateManyMutationInput';
|
||||||
|
import { CompanyWhereInput } from '../../../inputs/CompanyWhereInput';
|
||||||
|
|
||||||
|
@TypeGraphQL.ArgsType()
|
||||||
|
export class UpdateManyCompanyArgs {
|
||||||
|
@TypeGraphQL.Field((_type) => CompanyUpdateManyMutationInput, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
data!: CompanyUpdateManyMutationInput;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => CompanyWhereInput, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
where?: CompanyWhereInput | undefined;
|
||||||
|
}
|
||||||
@ -0,0 +1,17 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
import * as GraphQLScalars from 'graphql-scalars';
|
||||||
|
import { CompanyUpdateInput } from '../../../inputs/CompanyUpdateInput';
|
||||||
|
import { CompanyWhereUniqueInput } from '../../../inputs/CompanyWhereUniqueInput';
|
||||||
|
|
||||||
|
@TypeGraphQL.ArgsType()
|
||||||
|
export class UpdateOneCompanyArgs {
|
||||||
|
@TypeGraphQL.Field((_type) => CompanyUpdateInput, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
data!: CompanyUpdateInput;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => CompanyWhereUniqueInput, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
where!: CompanyWhereUniqueInput;
|
||||||
|
}
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
import * as GraphQLScalars from 'graphql-scalars';
|
||||||
|
import { CompanyCreateInput } from '../../../inputs/CompanyCreateInput';
|
||||||
|
import { CompanyUpdateInput } from '../../../inputs/CompanyUpdateInput';
|
||||||
|
import { CompanyWhereUniqueInput } from '../../../inputs/CompanyWhereUniqueInput';
|
||||||
|
|
||||||
|
@TypeGraphQL.ArgsType()
|
||||||
|
export class UpsertOneCompanyArgs {
|
||||||
|
@TypeGraphQL.Field((_type) => CompanyWhereUniqueInput, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
where!: CompanyWhereUniqueInput;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => CompanyCreateInput, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
create!: CompanyCreateInput;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => CompanyUpdateInput, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
update!: CompanyUpdateInput;
|
||||||
|
}
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
export { AggregateCompanyArgs } from "./AggregateCompanyArgs";
|
||||||
|
export { CreateManyCompanyArgs } from "./CreateManyCompanyArgs";
|
||||||
|
export { CreateOneCompanyArgs } from "./CreateOneCompanyArgs";
|
||||||
|
export { DeleteManyCompanyArgs } from "./DeleteManyCompanyArgs";
|
||||||
|
export { DeleteOneCompanyArgs } from "./DeleteOneCompanyArgs";
|
||||||
|
export { FindFirstCompanyArgs } from "./FindFirstCompanyArgs";
|
||||||
|
export { FindFirstCompanyOrThrowArgs } from "./FindFirstCompanyOrThrowArgs";
|
||||||
|
export { FindManyCompanyArgs } from "./FindManyCompanyArgs";
|
||||||
|
export { FindUniqueCompanyArgs } from "./FindUniqueCompanyArgs";
|
||||||
|
export { FindUniqueCompanyOrThrowArgs } from "./FindUniqueCompanyOrThrowArgs";
|
||||||
|
export { GroupByCompanyArgs } from "./GroupByCompanyArgs";
|
||||||
|
export { UpdateManyCompanyArgs } from "./UpdateManyCompanyArgs";
|
||||||
|
export { UpdateOneCompanyArgs } from "./UpdateOneCompanyArgs";
|
||||||
|
export { UpsertOneCompanyArgs } from "./UpsertOneCompanyArgs";
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
import * as TypeGraphQL from "type-graphql";
|
||||||
|
import type { GraphQLResolveInfo } from "graphql";
|
||||||
|
import { AggregatePersonArgs } from "./args/AggregatePersonArgs";
|
||||||
|
import { Person } from "../../../models/Person";
|
||||||
|
import { AggregatePerson } from "../../outputs/AggregatePerson";
|
||||||
|
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||||
|
|
||||||
|
@TypeGraphQL.Resolver(_of => Person)
|
||||||
|
export class AggregatePersonResolver {
|
||||||
|
@TypeGraphQL.Query(_returns => AggregatePerson, {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async aggregatePerson(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: AggregatePersonArgs): Promise<AggregatePerson> {
|
||||||
|
return getPrismaFromContext(ctx).person.aggregate({
|
||||||
|
...args,
|
||||||
|
...transformInfoIntoPrismaArgs(info),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,20 @@
|
|||||||
|
import * as TypeGraphQL from "type-graphql";
|
||||||
|
import type { GraphQLResolveInfo } from "graphql";
|
||||||
|
import { CreateManyPersonArgs } from "./args/CreateManyPersonArgs";
|
||||||
|
import { Person } from "../../../models/Person";
|
||||||
|
import { AffectedRowsOutput } from "../../outputs/AffectedRowsOutput";
|
||||||
|
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||||
|
|
||||||
|
@TypeGraphQL.Resolver(_of => Person)
|
||||||
|
export class CreateManyPersonResolver {
|
||||||
|
@TypeGraphQL.Mutation(_returns => AffectedRowsOutput, {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async createManyPerson(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: CreateManyPersonArgs): Promise<AffectedRowsOutput> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).person.createMany({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
import * as TypeGraphQL from "type-graphql";
|
||||||
|
import type { GraphQLResolveInfo } from "graphql";
|
||||||
|
import { CreateOnePersonArgs } from "./args/CreateOnePersonArgs";
|
||||||
|
import { Person } from "../../../models/Person";
|
||||||
|
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||||
|
|
||||||
|
@TypeGraphQL.Resolver(_of => Person)
|
||||||
|
export class CreateOnePersonResolver {
|
||||||
|
@TypeGraphQL.Mutation(_returns => Person, {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async createOnePerson(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: CreateOnePersonArgs): Promise<Person> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).person.create({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,20 @@
|
|||||||
|
import * as TypeGraphQL from "type-graphql";
|
||||||
|
import type { GraphQLResolveInfo } from "graphql";
|
||||||
|
import { DeleteManyPersonArgs } from "./args/DeleteManyPersonArgs";
|
||||||
|
import { Person } from "../../../models/Person";
|
||||||
|
import { AffectedRowsOutput } from "../../outputs/AffectedRowsOutput";
|
||||||
|
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||||
|
|
||||||
|
@TypeGraphQL.Resolver(_of => Person)
|
||||||
|
export class DeleteManyPersonResolver {
|
||||||
|
@TypeGraphQL.Mutation(_returns => AffectedRowsOutput, {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async deleteManyPerson(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: DeleteManyPersonArgs): Promise<AffectedRowsOutput> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).person.deleteMany({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
import * as TypeGraphQL from "type-graphql";
|
||||||
|
import type { GraphQLResolveInfo } from "graphql";
|
||||||
|
import { DeleteOnePersonArgs } from "./args/DeleteOnePersonArgs";
|
||||||
|
import { Person } from "../../../models/Person";
|
||||||
|
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||||
|
|
||||||
|
@TypeGraphQL.Resolver(_of => Person)
|
||||||
|
export class DeleteOnePersonResolver {
|
||||||
|
@TypeGraphQL.Mutation(_returns => Person, {
|
||||||
|
nullable: true
|
||||||
|
})
|
||||||
|
async deleteOnePerson(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: DeleteOnePersonArgs): Promise<Person | null> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).person.delete({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
import * as TypeGraphQL from "type-graphql";
|
||||||
|
import type { GraphQLResolveInfo } from "graphql";
|
||||||
|
import { FindFirstPersonOrThrowArgs } from "./args/FindFirstPersonOrThrowArgs";
|
||||||
|
import { Person } from "../../../models/Person";
|
||||||
|
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||||
|
|
||||||
|
@TypeGraphQL.Resolver(_of => Person)
|
||||||
|
export class FindFirstPersonOrThrowResolver {
|
||||||
|
@TypeGraphQL.Query(_returns => Person, {
|
||||||
|
nullable: true
|
||||||
|
})
|
||||||
|
async findFirstPersonOrThrow(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: FindFirstPersonOrThrowArgs): Promise<Person | null> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).person.findFirstOrThrow({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
import * as TypeGraphQL from "type-graphql";
|
||||||
|
import type { GraphQLResolveInfo } from "graphql";
|
||||||
|
import { FindFirstPersonArgs } from "./args/FindFirstPersonArgs";
|
||||||
|
import { Person } from "../../../models/Person";
|
||||||
|
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||||
|
|
||||||
|
@TypeGraphQL.Resolver(_of => Person)
|
||||||
|
export class FindFirstPersonResolver {
|
||||||
|
@TypeGraphQL.Query(_returns => Person, {
|
||||||
|
nullable: true
|
||||||
|
})
|
||||||
|
async findFirstPerson(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: FindFirstPersonArgs): Promise<Person | null> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).person.findFirst({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
import * as TypeGraphQL from "type-graphql";
|
||||||
|
import type { GraphQLResolveInfo } from "graphql";
|
||||||
|
import { FindManyPersonArgs } from "./args/FindManyPersonArgs";
|
||||||
|
import { Person } from "../../../models/Person";
|
||||||
|
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||||
|
|
||||||
|
@TypeGraphQL.Resolver(_of => Person)
|
||||||
|
export class FindManyPersonResolver {
|
||||||
|
@TypeGraphQL.Query(_returns => [Person], {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async people(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: FindManyPersonArgs): Promise<Person[]> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).person.findMany({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
import * as TypeGraphQL from "type-graphql";
|
||||||
|
import type { GraphQLResolveInfo } from "graphql";
|
||||||
|
import { FindUniquePersonOrThrowArgs } from "./args/FindUniquePersonOrThrowArgs";
|
||||||
|
import { Person } from "../../../models/Person";
|
||||||
|
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||||
|
|
||||||
|
@TypeGraphQL.Resolver(_of => Person)
|
||||||
|
export class FindUniquePersonOrThrowResolver {
|
||||||
|
@TypeGraphQL.Query(_returns => Person, {
|
||||||
|
nullable: true
|
||||||
|
})
|
||||||
|
async getPerson(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: FindUniquePersonOrThrowArgs): Promise<Person | null> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).person.findUniqueOrThrow({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
import * as TypeGraphQL from "type-graphql";
|
||||||
|
import type { GraphQLResolveInfo } from "graphql";
|
||||||
|
import { FindUniquePersonArgs } from "./args/FindUniquePersonArgs";
|
||||||
|
import { Person } from "../../../models/Person";
|
||||||
|
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||||
|
|
||||||
|
@TypeGraphQL.Resolver(_of => Person)
|
||||||
|
export class FindUniquePersonResolver {
|
||||||
|
@TypeGraphQL.Query(_returns => Person, {
|
||||||
|
nullable: true
|
||||||
|
})
|
||||||
|
async person(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: FindUniquePersonArgs): Promise<Person | null> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).person.findUnique({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,22 @@
|
|||||||
|
import * as TypeGraphQL from "type-graphql";
|
||||||
|
import type { GraphQLResolveInfo } from "graphql";
|
||||||
|
import { GroupByPersonArgs } from "./args/GroupByPersonArgs";
|
||||||
|
import { Person } from "../../../models/Person";
|
||||||
|
import { PersonGroupBy } from "../../outputs/PersonGroupBy";
|
||||||
|
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||||
|
|
||||||
|
@TypeGraphQL.Resolver(_of => Person)
|
||||||
|
export class GroupByPersonResolver {
|
||||||
|
@TypeGraphQL.Query(_returns => [PersonGroupBy], {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async groupByPerson(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: GroupByPersonArgs): Promise<PersonGroupBy[]> {
|
||||||
|
const { _count, _avg, _sum, _min, _max } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).person.groupBy({
|
||||||
|
...args,
|
||||||
|
...Object.fromEntries(
|
||||||
|
Object.entries({ _count, _avg, _sum, _min, _max }).filter(([_, v]) => v != null)
|
||||||
|
),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,179 @@
|
|||||||
|
import * as TypeGraphQL from "type-graphql";
|
||||||
|
import type { GraphQLResolveInfo } from "graphql";
|
||||||
|
import { AggregatePersonArgs } from "./args/AggregatePersonArgs";
|
||||||
|
import { CreateManyPersonArgs } from "./args/CreateManyPersonArgs";
|
||||||
|
import { CreateOnePersonArgs } from "./args/CreateOnePersonArgs";
|
||||||
|
import { DeleteManyPersonArgs } from "./args/DeleteManyPersonArgs";
|
||||||
|
import { DeleteOnePersonArgs } from "./args/DeleteOnePersonArgs";
|
||||||
|
import { FindFirstPersonArgs } from "./args/FindFirstPersonArgs";
|
||||||
|
import { FindFirstPersonOrThrowArgs } from "./args/FindFirstPersonOrThrowArgs";
|
||||||
|
import { FindManyPersonArgs } from "./args/FindManyPersonArgs";
|
||||||
|
import { FindUniquePersonArgs } from "./args/FindUniquePersonArgs";
|
||||||
|
import { FindUniquePersonOrThrowArgs } from "./args/FindUniquePersonOrThrowArgs";
|
||||||
|
import { GroupByPersonArgs } from "./args/GroupByPersonArgs";
|
||||||
|
import { UpdateManyPersonArgs } from "./args/UpdateManyPersonArgs";
|
||||||
|
import { UpdateOnePersonArgs } from "./args/UpdateOnePersonArgs";
|
||||||
|
import { UpsertOnePersonArgs } from "./args/UpsertOnePersonArgs";
|
||||||
|
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||||
|
import { Person } from "../../../models/Person";
|
||||||
|
import { AffectedRowsOutput } from "../../outputs/AffectedRowsOutput";
|
||||||
|
import { AggregatePerson } from "../../outputs/AggregatePerson";
|
||||||
|
import { PersonGroupBy } from "../../outputs/PersonGroupBy";
|
||||||
|
|
||||||
|
@TypeGraphQL.Resolver(_of => Person)
|
||||||
|
export class PersonCrudResolver {
|
||||||
|
@TypeGraphQL.Query(_returns => AggregatePerson, {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async aggregatePerson(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: AggregatePersonArgs): Promise<AggregatePerson> {
|
||||||
|
return getPrismaFromContext(ctx).person.aggregate({
|
||||||
|
...args,
|
||||||
|
...transformInfoIntoPrismaArgs(info),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@TypeGraphQL.Mutation(_returns => AffectedRowsOutput, {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async createManyPerson(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: CreateManyPersonArgs): Promise<AffectedRowsOutput> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).person.createMany({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@TypeGraphQL.Mutation(_returns => Person, {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async createOnePerson(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: CreateOnePersonArgs): Promise<Person> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).person.create({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@TypeGraphQL.Mutation(_returns => AffectedRowsOutput, {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async deleteManyPerson(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: DeleteManyPersonArgs): Promise<AffectedRowsOutput> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).person.deleteMany({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@TypeGraphQL.Mutation(_returns => Person, {
|
||||||
|
nullable: true
|
||||||
|
})
|
||||||
|
async deleteOnePerson(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: DeleteOnePersonArgs): Promise<Person | null> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).person.delete({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@TypeGraphQL.Query(_returns => Person, {
|
||||||
|
nullable: true
|
||||||
|
})
|
||||||
|
async findFirstPerson(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: FindFirstPersonArgs): Promise<Person | null> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).person.findFirst({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@TypeGraphQL.Query(_returns => Person, {
|
||||||
|
nullable: true
|
||||||
|
})
|
||||||
|
async findFirstPersonOrThrow(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: FindFirstPersonOrThrowArgs): Promise<Person | null> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).person.findFirstOrThrow({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@TypeGraphQL.Query(_returns => [Person], {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async people(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: FindManyPersonArgs): Promise<Person[]> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).person.findMany({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@TypeGraphQL.Query(_returns => Person, {
|
||||||
|
nullable: true
|
||||||
|
})
|
||||||
|
async person(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: FindUniquePersonArgs): Promise<Person | null> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).person.findUnique({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@TypeGraphQL.Query(_returns => Person, {
|
||||||
|
nullable: true
|
||||||
|
})
|
||||||
|
async getPerson(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: FindUniquePersonOrThrowArgs): Promise<Person | null> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).person.findUniqueOrThrow({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@TypeGraphQL.Query(_returns => [PersonGroupBy], {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async groupByPerson(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: GroupByPersonArgs): Promise<PersonGroupBy[]> {
|
||||||
|
const { _count, _avg, _sum, _min, _max } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).person.groupBy({
|
||||||
|
...args,
|
||||||
|
...Object.fromEntries(
|
||||||
|
Object.entries({ _count, _avg, _sum, _min, _max }).filter(([_, v]) => v != null)
|
||||||
|
),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@TypeGraphQL.Mutation(_returns => AffectedRowsOutput, {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async updateManyPerson(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: UpdateManyPersonArgs): Promise<AffectedRowsOutput> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).person.updateMany({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@TypeGraphQL.Mutation(_returns => Person, {
|
||||||
|
nullable: true
|
||||||
|
})
|
||||||
|
async updateOnePerson(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: UpdateOnePersonArgs): Promise<Person | null> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).person.update({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@TypeGraphQL.Mutation(_returns => Person, {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async upsertOnePerson(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: UpsertOnePersonArgs): Promise<Person> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).person.upsert({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,20 @@
|
|||||||
|
import * as TypeGraphQL from "type-graphql";
|
||||||
|
import type { GraphQLResolveInfo } from "graphql";
|
||||||
|
import { UpdateManyPersonArgs } from "./args/UpdateManyPersonArgs";
|
||||||
|
import { Person } from "../../../models/Person";
|
||||||
|
import { AffectedRowsOutput } from "../../outputs/AffectedRowsOutput";
|
||||||
|
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||||
|
|
||||||
|
@TypeGraphQL.Resolver(_of => Person)
|
||||||
|
export class UpdateManyPersonResolver {
|
||||||
|
@TypeGraphQL.Mutation(_returns => AffectedRowsOutput, {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async updateManyPerson(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: UpdateManyPersonArgs): Promise<AffectedRowsOutput> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).person.updateMany({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
import * as TypeGraphQL from "type-graphql";
|
||||||
|
import type { GraphQLResolveInfo } from "graphql";
|
||||||
|
import { UpdateOnePersonArgs } from "./args/UpdateOnePersonArgs";
|
||||||
|
import { Person } from "../../../models/Person";
|
||||||
|
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||||
|
|
||||||
|
@TypeGraphQL.Resolver(_of => Person)
|
||||||
|
export class UpdateOnePersonResolver {
|
||||||
|
@TypeGraphQL.Mutation(_returns => Person, {
|
||||||
|
nullable: true
|
||||||
|
})
|
||||||
|
async updateOnePerson(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: UpdateOnePersonArgs): Promise<Person | null> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).person.update({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
import * as TypeGraphQL from "type-graphql";
|
||||||
|
import type { GraphQLResolveInfo } from "graphql";
|
||||||
|
import { UpsertOnePersonArgs } from "./args/UpsertOnePersonArgs";
|
||||||
|
import { Person } from "../../../models/Person";
|
||||||
|
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||||
|
|
||||||
|
@TypeGraphQL.Resolver(_of => Person)
|
||||||
|
export class UpsertOnePersonResolver {
|
||||||
|
@TypeGraphQL.Mutation(_returns => Person, {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async upsertOnePerson(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: UpsertOnePersonArgs): Promise<Person> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).person.upsert({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,33 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
import * as GraphQLScalars from 'graphql-scalars';
|
||||||
|
import { PersonOrderByWithRelationInput } from '../../../inputs/PersonOrderByWithRelationInput';
|
||||||
|
import { PersonWhereInput } from '../../../inputs/PersonWhereInput';
|
||||||
|
import { PersonWhereUniqueInput } from '../../../inputs/PersonWhereUniqueInput';
|
||||||
|
|
||||||
|
@TypeGraphQL.ArgsType()
|
||||||
|
export class AggregatePersonArgs {
|
||||||
|
@TypeGraphQL.Field((_type) => PersonWhereInput, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
where?: PersonWhereInput | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => [PersonOrderByWithRelationInput], {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
orderBy?: PersonOrderByWithRelationInput[] | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => PersonWhereUniqueInput, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
cursor?: PersonWhereUniqueInput | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => TypeGraphQL.Int, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
take?: number | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => TypeGraphQL.Int, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
skip?: number | undefined;
|
||||||
|
}
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
import * as GraphQLScalars from 'graphql-scalars';
|
||||||
|
import { PersonCreateManyInput } from '../../../inputs/PersonCreateManyInput';
|
||||||
|
|
||||||
|
@TypeGraphQL.ArgsType()
|
||||||
|
export class CreateManyPersonArgs {
|
||||||
|
@TypeGraphQL.Field((_type) => [PersonCreateManyInput], {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
data!: PersonCreateManyInput[];
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => Boolean, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
skipDuplicates?: boolean | undefined;
|
||||||
|
}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
import * as GraphQLScalars from 'graphql-scalars';
|
||||||
|
import { PersonCreateInput } from '../../../inputs/PersonCreateInput';
|
||||||
|
|
||||||
|
@TypeGraphQL.ArgsType()
|
||||||
|
export class CreateOnePersonArgs {
|
||||||
|
@TypeGraphQL.Field((_type) => PersonCreateInput, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
data!: PersonCreateInput;
|
||||||
|
}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
import * as GraphQLScalars from 'graphql-scalars';
|
||||||
|
import { PersonWhereInput } from '../../../inputs/PersonWhereInput';
|
||||||
|
|
||||||
|
@TypeGraphQL.ArgsType()
|
||||||
|
export class DeleteManyPersonArgs {
|
||||||
|
@TypeGraphQL.Field((_type) => PersonWhereInput, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
where?: PersonWhereInput | undefined;
|
||||||
|
}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
import * as GraphQLScalars from 'graphql-scalars';
|
||||||
|
import { PersonWhereUniqueInput } from '../../../inputs/PersonWhereUniqueInput';
|
||||||
|
|
||||||
|
@TypeGraphQL.ArgsType()
|
||||||
|
export class DeleteOnePersonArgs {
|
||||||
|
@TypeGraphQL.Field((_type) => PersonWhereUniqueInput, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
where!: PersonWhereUniqueInput;
|
||||||
|
}
|
||||||
@ -0,0 +1,53 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
import * as GraphQLScalars from 'graphql-scalars';
|
||||||
|
import { PersonOrderByWithRelationInput } from '../../../inputs/PersonOrderByWithRelationInput';
|
||||||
|
import { PersonWhereInput } from '../../../inputs/PersonWhereInput';
|
||||||
|
import { PersonWhereUniqueInput } from '../../../inputs/PersonWhereUniqueInput';
|
||||||
|
import { PersonScalarFieldEnum } from '../../../../enums/PersonScalarFieldEnum';
|
||||||
|
|
||||||
|
@TypeGraphQL.ArgsType()
|
||||||
|
export class FindFirstPersonArgs {
|
||||||
|
@TypeGraphQL.Field((_type) => PersonWhereInput, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
where?: PersonWhereInput | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => [PersonOrderByWithRelationInput], {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
orderBy?: PersonOrderByWithRelationInput[] | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => PersonWhereUniqueInput, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
cursor?: PersonWhereUniqueInput | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => TypeGraphQL.Int, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
take?: number | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => TypeGraphQL.Int, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
skip?: number | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => [PersonScalarFieldEnum], {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
distinct?:
|
||||||
|
| Array<
|
||||||
|
| 'id'
|
||||||
|
| 'createdAt'
|
||||||
|
| 'updatedAt'
|
||||||
|
| 'deletedAt'
|
||||||
|
| 'firstname'
|
||||||
|
| 'lastname'
|
||||||
|
| 'email'
|
||||||
|
| 'phone'
|
||||||
|
| 'city'
|
||||||
|
| 'companyId'
|
||||||
|
| 'workspaceId'
|
||||||
|
>
|
||||||
|
| undefined;
|
||||||
|
}
|
||||||
@ -0,0 +1,53 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
import * as GraphQLScalars from 'graphql-scalars';
|
||||||
|
import { PersonOrderByWithRelationInput } from '../../../inputs/PersonOrderByWithRelationInput';
|
||||||
|
import { PersonWhereInput } from '../../../inputs/PersonWhereInput';
|
||||||
|
import { PersonWhereUniqueInput } from '../../../inputs/PersonWhereUniqueInput';
|
||||||
|
import { PersonScalarFieldEnum } from '../../../../enums/PersonScalarFieldEnum';
|
||||||
|
|
||||||
|
@TypeGraphQL.ArgsType()
|
||||||
|
export class FindFirstPersonOrThrowArgs {
|
||||||
|
@TypeGraphQL.Field((_type) => PersonWhereInput, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
where?: PersonWhereInput | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => [PersonOrderByWithRelationInput], {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
orderBy?: PersonOrderByWithRelationInput[] | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => PersonWhereUniqueInput, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
cursor?: PersonWhereUniqueInput | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => TypeGraphQL.Int, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
take?: number | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => TypeGraphQL.Int, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
skip?: number | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => [PersonScalarFieldEnum], {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
distinct?:
|
||||||
|
| Array<
|
||||||
|
| 'id'
|
||||||
|
| 'createdAt'
|
||||||
|
| 'updatedAt'
|
||||||
|
| 'deletedAt'
|
||||||
|
| 'firstname'
|
||||||
|
| 'lastname'
|
||||||
|
| 'email'
|
||||||
|
| 'phone'
|
||||||
|
| 'city'
|
||||||
|
| 'companyId'
|
||||||
|
| 'workspaceId'
|
||||||
|
>
|
||||||
|
| undefined;
|
||||||
|
}
|
||||||
@ -0,0 +1,53 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
import * as GraphQLScalars from 'graphql-scalars';
|
||||||
|
import { PersonOrderByWithRelationInput } from '../../../inputs/PersonOrderByWithRelationInput';
|
||||||
|
import { PersonWhereInput } from '../../../inputs/PersonWhereInput';
|
||||||
|
import { PersonWhereUniqueInput } from '../../../inputs/PersonWhereUniqueInput';
|
||||||
|
import { PersonScalarFieldEnum } from '../../../../enums/PersonScalarFieldEnum';
|
||||||
|
|
||||||
|
@TypeGraphQL.ArgsType()
|
||||||
|
export class FindManyPersonArgs {
|
||||||
|
@TypeGraphQL.Field((_type) => PersonWhereInput, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
where?: PersonWhereInput | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => [PersonOrderByWithRelationInput], {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
orderBy?: PersonOrderByWithRelationInput[] | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => PersonWhereUniqueInput, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
cursor?: PersonWhereUniqueInput | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => TypeGraphQL.Int, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
take?: number | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => TypeGraphQL.Int, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
skip?: number | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => [PersonScalarFieldEnum], {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
distinct?:
|
||||||
|
| Array<
|
||||||
|
| 'id'
|
||||||
|
| 'createdAt'
|
||||||
|
| 'updatedAt'
|
||||||
|
| 'deletedAt'
|
||||||
|
| 'firstname'
|
||||||
|
| 'lastname'
|
||||||
|
| 'email'
|
||||||
|
| 'phone'
|
||||||
|
| 'city'
|
||||||
|
| 'companyId'
|
||||||
|
| 'workspaceId'
|
||||||
|
>
|
||||||
|
| undefined;
|
||||||
|
}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
import * as GraphQLScalars from 'graphql-scalars';
|
||||||
|
import { PersonWhereUniqueInput } from '../../../inputs/PersonWhereUniqueInput';
|
||||||
|
|
||||||
|
@TypeGraphQL.ArgsType()
|
||||||
|
export class FindUniquePersonArgs {
|
||||||
|
@TypeGraphQL.Field((_type) => PersonWhereUniqueInput, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
where!: PersonWhereUniqueInput;
|
||||||
|
}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
import * as GraphQLScalars from 'graphql-scalars';
|
||||||
|
import { PersonWhereUniqueInput } from '../../../inputs/PersonWhereUniqueInput';
|
||||||
|
|
||||||
|
@TypeGraphQL.ArgsType()
|
||||||
|
export class FindUniquePersonOrThrowArgs {
|
||||||
|
@TypeGraphQL.Field((_type) => PersonWhereUniqueInput, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
where!: PersonWhereUniqueInput;
|
||||||
|
}
|
||||||
@ -0,0 +1,51 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
import * as GraphQLScalars from 'graphql-scalars';
|
||||||
|
import { PersonOrderByWithAggregationInput } from '../../../inputs/PersonOrderByWithAggregationInput';
|
||||||
|
import { PersonScalarWhereWithAggregatesInput } from '../../../inputs/PersonScalarWhereWithAggregatesInput';
|
||||||
|
import { PersonWhereInput } from '../../../inputs/PersonWhereInput';
|
||||||
|
import { PersonScalarFieldEnum } from '../../../../enums/PersonScalarFieldEnum';
|
||||||
|
|
||||||
|
@TypeGraphQL.ArgsType()
|
||||||
|
export class GroupByPersonArgs {
|
||||||
|
@TypeGraphQL.Field((_type) => PersonWhereInput, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
where?: PersonWhereInput | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => [PersonOrderByWithAggregationInput], {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
orderBy?: PersonOrderByWithAggregationInput[] | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => [PersonScalarFieldEnum], {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
by!: Array<
|
||||||
|
| 'id'
|
||||||
|
| 'createdAt'
|
||||||
|
| 'updatedAt'
|
||||||
|
| 'deletedAt'
|
||||||
|
| 'firstname'
|
||||||
|
| 'lastname'
|
||||||
|
| 'email'
|
||||||
|
| 'phone'
|
||||||
|
| 'city'
|
||||||
|
| 'companyId'
|
||||||
|
| 'workspaceId'
|
||||||
|
>;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => PersonScalarWhereWithAggregatesInput, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
having?: PersonScalarWhereWithAggregatesInput | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => TypeGraphQL.Int, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
take?: number | undefined;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => TypeGraphQL.Int, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
skip?: number | undefined;
|
||||||
|
}
|
||||||
@ -0,0 +1,17 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
import * as GraphQLScalars from 'graphql-scalars';
|
||||||
|
import { PersonUpdateManyMutationInput } from '../../../inputs/PersonUpdateManyMutationInput';
|
||||||
|
import { PersonWhereInput } from '../../../inputs/PersonWhereInput';
|
||||||
|
|
||||||
|
@TypeGraphQL.ArgsType()
|
||||||
|
export class UpdateManyPersonArgs {
|
||||||
|
@TypeGraphQL.Field((_type) => PersonUpdateManyMutationInput, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
data!: PersonUpdateManyMutationInput;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => PersonWhereInput, {
|
||||||
|
nullable: true,
|
||||||
|
})
|
||||||
|
where?: PersonWhereInput | undefined;
|
||||||
|
}
|
||||||
@ -0,0 +1,17 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
import * as GraphQLScalars from 'graphql-scalars';
|
||||||
|
import { PersonUpdateInput } from '../../../inputs/PersonUpdateInput';
|
||||||
|
import { PersonWhereUniqueInput } from '../../../inputs/PersonWhereUniqueInput';
|
||||||
|
|
||||||
|
@TypeGraphQL.ArgsType()
|
||||||
|
export class UpdateOnePersonArgs {
|
||||||
|
@TypeGraphQL.Field((_type) => PersonUpdateInput, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
data!: PersonUpdateInput;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => PersonWhereUniqueInput, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
where!: PersonWhereUniqueInput;
|
||||||
|
}
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
import * as TypeGraphQL from '@nestjs/graphql';
|
||||||
|
import * as GraphQLScalars from 'graphql-scalars';
|
||||||
|
import { PersonCreateInput } from '../../../inputs/PersonCreateInput';
|
||||||
|
import { PersonUpdateInput } from '../../../inputs/PersonUpdateInput';
|
||||||
|
import { PersonWhereUniqueInput } from '../../../inputs/PersonWhereUniqueInput';
|
||||||
|
|
||||||
|
@TypeGraphQL.ArgsType()
|
||||||
|
export class UpsertOnePersonArgs {
|
||||||
|
@TypeGraphQL.Field((_type) => PersonWhereUniqueInput, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
where!: PersonWhereUniqueInput;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => PersonCreateInput, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
create!: PersonCreateInput;
|
||||||
|
|
||||||
|
@TypeGraphQL.Field((_type) => PersonUpdateInput, {
|
||||||
|
nullable: false,
|
||||||
|
})
|
||||||
|
update!: PersonUpdateInput;
|
||||||
|
}
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
export { AggregatePersonArgs } from "./AggregatePersonArgs";
|
||||||
|
export { CreateManyPersonArgs } from "./CreateManyPersonArgs";
|
||||||
|
export { CreateOnePersonArgs } from "./CreateOnePersonArgs";
|
||||||
|
export { DeleteManyPersonArgs } from "./DeleteManyPersonArgs";
|
||||||
|
export { DeleteOnePersonArgs } from "./DeleteOnePersonArgs";
|
||||||
|
export { FindFirstPersonArgs } from "./FindFirstPersonArgs";
|
||||||
|
export { FindFirstPersonOrThrowArgs } from "./FindFirstPersonOrThrowArgs";
|
||||||
|
export { FindManyPersonArgs } from "./FindManyPersonArgs";
|
||||||
|
export { FindUniquePersonArgs } from "./FindUniquePersonArgs";
|
||||||
|
export { FindUniquePersonOrThrowArgs } from "./FindUniquePersonOrThrowArgs";
|
||||||
|
export { GroupByPersonArgs } from "./GroupByPersonArgs";
|
||||||
|
export { UpdateManyPersonArgs } from "./UpdateManyPersonArgs";
|
||||||
|
export { UpdateOnePersonArgs } from "./UpdateOnePersonArgs";
|
||||||
|
export { UpsertOnePersonArgs } from "./UpsertOnePersonArgs";
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
import * as TypeGraphQL from "type-graphql";
|
||||||
|
import type { GraphQLResolveInfo } from "graphql";
|
||||||
|
import { AggregateRefreshTokenArgs } from "./args/AggregateRefreshTokenArgs";
|
||||||
|
import { RefreshToken } from "../../../models/RefreshToken";
|
||||||
|
import { AggregateRefreshToken } from "../../outputs/AggregateRefreshToken";
|
||||||
|
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||||
|
|
||||||
|
@TypeGraphQL.Resolver(_of => RefreshToken)
|
||||||
|
export class AggregateRefreshTokenResolver {
|
||||||
|
@TypeGraphQL.Query(_returns => AggregateRefreshToken, {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async aggregateRefreshToken(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: AggregateRefreshTokenArgs): Promise<AggregateRefreshToken> {
|
||||||
|
return getPrismaFromContext(ctx).refreshToken.aggregate({
|
||||||
|
...args,
|
||||||
|
...transformInfoIntoPrismaArgs(info),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,20 @@
|
|||||||
|
import * as TypeGraphQL from "type-graphql";
|
||||||
|
import type { GraphQLResolveInfo } from "graphql";
|
||||||
|
import { CreateManyRefreshTokenArgs } from "./args/CreateManyRefreshTokenArgs";
|
||||||
|
import { RefreshToken } from "../../../models/RefreshToken";
|
||||||
|
import { AffectedRowsOutput } from "../../outputs/AffectedRowsOutput";
|
||||||
|
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||||
|
|
||||||
|
@TypeGraphQL.Resolver(_of => RefreshToken)
|
||||||
|
export class CreateManyRefreshTokenResolver {
|
||||||
|
@TypeGraphQL.Mutation(_returns => AffectedRowsOutput, {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async createManyRefreshToken(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: CreateManyRefreshTokenArgs): Promise<AffectedRowsOutput> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).refreshToken.createMany({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
import * as TypeGraphQL from "type-graphql";
|
||||||
|
import type { GraphQLResolveInfo } from "graphql";
|
||||||
|
import { CreateOneRefreshTokenArgs } from "./args/CreateOneRefreshTokenArgs";
|
||||||
|
import { RefreshToken } from "../../../models/RefreshToken";
|
||||||
|
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||||
|
|
||||||
|
@TypeGraphQL.Resolver(_of => RefreshToken)
|
||||||
|
export class CreateOneRefreshTokenResolver {
|
||||||
|
@TypeGraphQL.Mutation(_returns => RefreshToken, {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async createOneRefreshToken(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: CreateOneRefreshTokenArgs): Promise<RefreshToken> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).refreshToken.create({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,20 @@
|
|||||||
|
import * as TypeGraphQL from "type-graphql";
|
||||||
|
import type { GraphQLResolveInfo } from "graphql";
|
||||||
|
import { DeleteManyRefreshTokenArgs } from "./args/DeleteManyRefreshTokenArgs";
|
||||||
|
import { RefreshToken } from "../../../models/RefreshToken";
|
||||||
|
import { AffectedRowsOutput } from "../../outputs/AffectedRowsOutput";
|
||||||
|
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||||
|
|
||||||
|
@TypeGraphQL.Resolver(_of => RefreshToken)
|
||||||
|
export class DeleteManyRefreshTokenResolver {
|
||||||
|
@TypeGraphQL.Mutation(_returns => AffectedRowsOutput, {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async deleteManyRefreshToken(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: DeleteManyRefreshTokenArgs): Promise<AffectedRowsOutput> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).refreshToken.deleteMany({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
import * as TypeGraphQL from "type-graphql";
|
||||||
|
import type { GraphQLResolveInfo } from "graphql";
|
||||||
|
import { DeleteOneRefreshTokenArgs } from "./args/DeleteOneRefreshTokenArgs";
|
||||||
|
import { RefreshToken } from "../../../models/RefreshToken";
|
||||||
|
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||||
|
|
||||||
|
@TypeGraphQL.Resolver(_of => RefreshToken)
|
||||||
|
export class DeleteOneRefreshTokenResolver {
|
||||||
|
@TypeGraphQL.Mutation(_returns => RefreshToken, {
|
||||||
|
nullable: true
|
||||||
|
})
|
||||||
|
async deleteOneRefreshToken(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: DeleteOneRefreshTokenArgs): Promise<RefreshToken | null> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).refreshToken.delete({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
import * as TypeGraphQL from "type-graphql";
|
||||||
|
import type { GraphQLResolveInfo } from "graphql";
|
||||||
|
import { FindFirstRefreshTokenOrThrowArgs } from "./args/FindFirstRefreshTokenOrThrowArgs";
|
||||||
|
import { RefreshToken } from "../../../models/RefreshToken";
|
||||||
|
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||||
|
|
||||||
|
@TypeGraphQL.Resolver(_of => RefreshToken)
|
||||||
|
export class FindFirstRefreshTokenOrThrowResolver {
|
||||||
|
@TypeGraphQL.Query(_returns => RefreshToken, {
|
||||||
|
nullable: true
|
||||||
|
})
|
||||||
|
async findFirstRefreshTokenOrThrow(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: FindFirstRefreshTokenOrThrowArgs): Promise<RefreshToken | null> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).refreshToken.findFirstOrThrow({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
import * as TypeGraphQL from "type-graphql";
|
||||||
|
import type { GraphQLResolveInfo } from "graphql";
|
||||||
|
import { FindFirstRefreshTokenArgs } from "./args/FindFirstRefreshTokenArgs";
|
||||||
|
import { RefreshToken } from "../../../models/RefreshToken";
|
||||||
|
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||||
|
|
||||||
|
@TypeGraphQL.Resolver(_of => RefreshToken)
|
||||||
|
export class FindFirstRefreshTokenResolver {
|
||||||
|
@TypeGraphQL.Query(_returns => RefreshToken, {
|
||||||
|
nullable: true
|
||||||
|
})
|
||||||
|
async findFirstRefreshToken(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: FindFirstRefreshTokenArgs): Promise<RefreshToken | null> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).refreshToken.findFirst({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
import * as TypeGraphQL from "type-graphql";
|
||||||
|
import type { GraphQLResolveInfo } from "graphql";
|
||||||
|
import { FindManyRefreshTokenArgs } from "./args/FindManyRefreshTokenArgs";
|
||||||
|
import { RefreshToken } from "../../../models/RefreshToken";
|
||||||
|
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||||
|
|
||||||
|
@TypeGraphQL.Resolver(_of => RefreshToken)
|
||||||
|
export class FindManyRefreshTokenResolver {
|
||||||
|
@TypeGraphQL.Query(_returns => [RefreshToken], {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async refreshTokens(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: FindManyRefreshTokenArgs): Promise<RefreshToken[]> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).refreshToken.findMany({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
import * as TypeGraphQL from "type-graphql";
|
||||||
|
import type { GraphQLResolveInfo } from "graphql";
|
||||||
|
import { FindUniqueRefreshTokenOrThrowArgs } from "./args/FindUniqueRefreshTokenOrThrowArgs";
|
||||||
|
import { RefreshToken } from "../../../models/RefreshToken";
|
||||||
|
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||||
|
|
||||||
|
@TypeGraphQL.Resolver(_of => RefreshToken)
|
||||||
|
export class FindUniqueRefreshTokenOrThrowResolver {
|
||||||
|
@TypeGraphQL.Query(_returns => RefreshToken, {
|
||||||
|
nullable: true
|
||||||
|
})
|
||||||
|
async getRefreshToken(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: FindUniqueRefreshTokenOrThrowArgs): Promise<RefreshToken | null> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).refreshToken.findUniqueOrThrow({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
import * as TypeGraphQL from "type-graphql";
|
||||||
|
import type { GraphQLResolveInfo } from "graphql";
|
||||||
|
import { FindUniqueRefreshTokenArgs } from "./args/FindUniqueRefreshTokenArgs";
|
||||||
|
import { RefreshToken } from "../../../models/RefreshToken";
|
||||||
|
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||||
|
|
||||||
|
@TypeGraphQL.Resolver(_of => RefreshToken)
|
||||||
|
export class FindUniqueRefreshTokenResolver {
|
||||||
|
@TypeGraphQL.Query(_returns => RefreshToken, {
|
||||||
|
nullable: true
|
||||||
|
})
|
||||||
|
async refreshToken(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: FindUniqueRefreshTokenArgs): Promise<RefreshToken | null> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).refreshToken.findUnique({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,22 @@
|
|||||||
|
import * as TypeGraphQL from "type-graphql";
|
||||||
|
import type { GraphQLResolveInfo } from "graphql";
|
||||||
|
import { GroupByRefreshTokenArgs } from "./args/GroupByRefreshTokenArgs";
|
||||||
|
import { RefreshToken } from "../../../models/RefreshToken";
|
||||||
|
import { RefreshTokenGroupBy } from "../../outputs/RefreshTokenGroupBy";
|
||||||
|
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||||
|
|
||||||
|
@TypeGraphQL.Resolver(_of => RefreshToken)
|
||||||
|
export class GroupByRefreshTokenResolver {
|
||||||
|
@TypeGraphQL.Query(_returns => [RefreshTokenGroupBy], {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async groupByRefreshToken(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: GroupByRefreshTokenArgs): Promise<RefreshTokenGroupBy[]> {
|
||||||
|
const { _count, _avg, _sum, _min, _max } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).refreshToken.groupBy({
|
||||||
|
...args,
|
||||||
|
...Object.fromEntries(
|
||||||
|
Object.entries({ _count, _avg, _sum, _min, _max }).filter(([_, v]) => v != null)
|
||||||
|
),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,179 @@
|
|||||||
|
import * as TypeGraphQL from "type-graphql";
|
||||||
|
import type { GraphQLResolveInfo } from "graphql";
|
||||||
|
import { AggregateRefreshTokenArgs } from "./args/AggregateRefreshTokenArgs";
|
||||||
|
import { CreateManyRefreshTokenArgs } from "./args/CreateManyRefreshTokenArgs";
|
||||||
|
import { CreateOneRefreshTokenArgs } from "./args/CreateOneRefreshTokenArgs";
|
||||||
|
import { DeleteManyRefreshTokenArgs } from "./args/DeleteManyRefreshTokenArgs";
|
||||||
|
import { DeleteOneRefreshTokenArgs } from "./args/DeleteOneRefreshTokenArgs";
|
||||||
|
import { FindFirstRefreshTokenArgs } from "./args/FindFirstRefreshTokenArgs";
|
||||||
|
import { FindFirstRefreshTokenOrThrowArgs } from "./args/FindFirstRefreshTokenOrThrowArgs";
|
||||||
|
import { FindManyRefreshTokenArgs } from "./args/FindManyRefreshTokenArgs";
|
||||||
|
import { FindUniqueRefreshTokenArgs } from "./args/FindUniqueRefreshTokenArgs";
|
||||||
|
import { FindUniqueRefreshTokenOrThrowArgs } from "./args/FindUniqueRefreshTokenOrThrowArgs";
|
||||||
|
import { GroupByRefreshTokenArgs } from "./args/GroupByRefreshTokenArgs";
|
||||||
|
import { UpdateManyRefreshTokenArgs } from "./args/UpdateManyRefreshTokenArgs";
|
||||||
|
import { UpdateOneRefreshTokenArgs } from "./args/UpdateOneRefreshTokenArgs";
|
||||||
|
import { UpsertOneRefreshTokenArgs } from "./args/UpsertOneRefreshTokenArgs";
|
||||||
|
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||||
|
import { RefreshToken } from "../../../models/RefreshToken";
|
||||||
|
import { AffectedRowsOutput } from "../../outputs/AffectedRowsOutput";
|
||||||
|
import { AggregateRefreshToken } from "../../outputs/AggregateRefreshToken";
|
||||||
|
import { RefreshTokenGroupBy } from "../../outputs/RefreshTokenGroupBy";
|
||||||
|
|
||||||
|
@TypeGraphQL.Resolver(_of => RefreshToken)
|
||||||
|
export class RefreshTokenCrudResolver {
|
||||||
|
@TypeGraphQL.Query(_returns => AggregateRefreshToken, {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async aggregateRefreshToken(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: AggregateRefreshTokenArgs): Promise<AggregateRefreshToken> {
|
||||||
|
return getPrismaFromContext(ctx).refreshToken.aggregate({
|
||||||
|
...args,
|
||||||
|
...transformInfoIntoPrismaArgs(info),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@TypeGraphQL.Mutation(_returns => AffectedRowsOutput, {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async createManyRefreshToken(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: CreateManyRefreshTokenArgs): Promise<AffectedRowsOutput> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).refreshToken.createMany({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@TypeGraphQL.Mutation(_returns => RefreshToken, {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async createOneRefreshToken(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: CreateOneRefreshTokenArgs): Promise<RefreshToken> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).refreshToken.create({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@TypeGraphQL.Mutation(_returns => AffectedRowsOutput, {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async deleteManyRefreshToken(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: DeleteManyRefreshTokenArgs): Promise<AffectedRowsOutput> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).refreshToken.deleteMany({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@TypeGraphQL.Mutation(_returns => RefreshToken, {
|
||||||
|
nullable: true
|
||||||
|
})
|
||||||
|
async deleteOneRefreshToken(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: DeleteOneRefreshTokenArgs): Promise<RefreshToken | null> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).refreshToken.delete({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@TypeGraphQL.Query(_returns => RefreshToken, {
|
||||||
|
nullable: true
|
||||||
|
})
|
||||||
|
async findFirstRefreshToken(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: FindFirstRefreshTokenArgs): Promise<RefreshToken | null> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).refreshToken.findFirst({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@TypeGraphQL.Query(_returns => RefreshToken, {
|
||||||
|
nullable: true
|
||||||
|
})
|
||||||
|
async findFirstRefreshTokenOrThrow(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: FindFirstRefreshTokenOrThrowArgs): Promise<RefreshToken | null> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).refreshToken.findFirstOrThrow({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@TypeGraphQL.Query(_returns => [RefreshToken], {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async refreshTokens(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: FindManyRefreshTokenArgs): Promise<RefreshToken[]> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).refreshToken.findMany({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@TypeGraphQL.Query(_returns => RefreshToken, {
|
||||||
|
nullable: true
|
||||||
|
})
|
||||||
|
async refreshToken(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: FindUniqueRefreshTokenArgs): Promise<RefreshToken | null> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).refreshToken.findUnique({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@TypeGraphQL.Query(_returns => RefreshToken, {
|
||||||
|
nullable: true
|
||||||
|
})
|
||||||
|
async getRefreshToken(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: FindUniqueRefreshTokenOrThrowArgs): Promise<RefreshToken | null> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).refreshToken.findUniqueOrThrow({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@TypeGraphQL.Query(_returns => [RefreshTokenGroupBy], {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async groupByRefreshToken(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: GroupByRefreshTokenArgs): Promise<RefreshTokenGroupBy[]> {
|
||||||
|
const { _count, _avg, _sum, _min, _max } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).refreshToken.groupBy({
|
||||||
|
...args,
|
||||||
|
...Object.fromEntries(
|
||||||
|
Object.entries({ _count, _avg, _sum, _min, _max }).filter(([_, v]) => v != null)
|
||||||
|
),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@TypeGraphQL.Mutation(_returns => AffectedRowsOutput, {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async updateManyRefreshToken(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: UpdateManyRefreshTokenArgs): Promise<AffectedRowsOutput> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).refreshToken.updateMany({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@TypeGraphQL.Mutation(_returns => RefreshToken, {
|
||||||
|
nullable: true
|
||||||
|
})
|
||||||
|
async updateOneRefreshToken(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: UpdateOneRefreshTokenArgs): Promise<RefreshToken | null> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).refreshToken.update({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@TypeGraphQL.Mutation(_returns => RefreshToken, {
|
||||||
|
nullable: false
|
||||||
|
})
|
||||||
|
async upsertOneRefreshToken(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: UpsertOneRefreshTokenArgs): Promise<RefreshToken> {
|
||||||
|
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||||
|
return getPrismaFromContext(ctx).refreshToken.upsert({
|
||||||
|
...args,
|
||||||
|
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user