Lucas/t 231 timebox i can create a company at the same time im creating (#140)
This PR is a bit messy: adding graphql schema adding create company creation on company select on People page some frontend refactoring to be continued --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -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 "type-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 "type-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 "type-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 "type-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 "type-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,39 @@
|
||||
import * as TypeGraphQL from "type-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,39 @@
|
||||
import * as TypeGraphQL from "type-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,39 @@
|
||||
import * as TypeGraphQL from "type-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 "type-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 "type-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,39 @@
|
||||
import * as TypeGraphQL from "type-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 "type-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 "type-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 "type-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;
|
||||
}
|
||||
14
server/src/api/graphql/resolvers/crud/Company/args/index.ts
Normal file
14
server/src/api/graphql/resolvers/crud/Company/args/index.ts
Normal file
@ -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 "type-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 "type-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 "type-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 "type-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 "type-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,39 @@
|
||||
import * as TypeGraphQL from "type-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,39 @@
|
||||
import * as TypeGraphQL from "type-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,39 @@
|
||||
import * as TypeGraphQL from "type-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 "type-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 "type-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,39 @@
|
||||
import * as TypeGraphQL from "type-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 "type-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 "type-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 "type-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;
|
||||
}
|
||||
14
server/src/api/graphql/resolvers/crud/Person/args/index.ts
Normal file
14
server/src/api/graphql/resolvers/crud/Person/args/index.ts
Normal file
@ -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)),
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
import * as TypeGraphQL from "type-graphql";
|
||||
import type { GraphQLResolveInfo } from "graphql";
|
||||
import { UpdateManyRefreshTokenArgs } from "./args/UpdateManyRefreshTokenArgs";
|
||||
import { RefreshToken } from "../../../models/RefreshToken";
|
||||
import { AffectedRowsOutput } from "../../outputs/AffectedRowsOutput";
|
||||
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||
|
||||
@TypeGraphQL.Resolver(_of => RefreshToken)
|
||||
export class UpdateManyRefreshTokenResolver {
|
||||
@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)),
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
import * as TypeGraphQL from "type-graphql";
|
||||
import type { GraphQLResolveInfo } from "graphql";
|
||||
import { UpdateOneRefreshTokenArgs } from "./args/UpdateOneRefreshTokenArgs";
|
||||
import { RefreshToken } from "../../../models/RefreshToken";
|
||||
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||
|
||||
@TypeGraphQL.Resolver(_of => RefreshToken)
|
||||
export class UpdateOneRefreshTokenResolver {
|
||||
@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)),
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
import * as TypeGraphQL from "type-graphql";
|
||||
import type { GraphQLResolveInfo } from "graphql";
|
||||
import { UpsertOneRefreshTokenArgs } from "./args/UpsertOneRefreshTokenArgs";
|
||||
import { RefreshToken } from "../../../models/RefreshToken";
|
||||
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||
|
||||
@TypeGraphQL.Resolver(_of => RefreshToken)
|
||||
export class UpsertOneRefreshTokenResolver {
|
||||
@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)),
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
import * as TypeGraphQL from "type-graphql";
|
||||
import * as GraphQLScalars from "graphql-scalars";
|
||||
import { RefreshTokenOrderByWithRelationInput } from "../../../inputs/RefreshTokenOrderByWithRelationInput";
|
||||
import { RefreshTokenWhereInput } from "../../../inputs/RefreshTokenWhereInput";
|
||||
import { RefreshTokenWhereUniqueInput } from "../../../inputs/RefreshTokenWhereUniqueInput";
|
||||
|
||||
@TypeGraphQL.ArgsType()
|
||||
export class AggregateRefreshTokenArgs {
|
||||
@TypeGraphQL.Field(_type => RefreshTokenWhereInput, {
|
||||
nullable: true
|
||||
})
|
||||
where?: RefreshTokenWhereInput | undefined;
|
||||
|
||||
@TypeGraphQL.Field(_type => [RefreshTokenOrderByWithRelationInput], {
|
||||
nullable: true
|
||||
})
|
||||
orderBy?: RefreshTokenOrderByWithRelationInput[] | undefined;
|
||||
|
||||
@TypeGraphQL.Field(_type => RefreshTokenWhereUniqueInput, {
|
||||
nullable: true
|
||||
})
|
||||
cursor?: RefreshTokenWhereUniqueInput | 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 "type-graphql";
|
||||
import * as GraphQLScalars from "graphql-scalars";
|
||||
import { RefreshTokenCreateManyInput } from "../../../inputs/RefreshTokenCreateManyInput";
|
||||
|
||||
@TypeGraphQL.ArgsType()
|
||||
export class CreateManyRefreshTokenArgs {
|
||||
@TypeGraphQL.Field(_type => [RefreshTokenCreateManyInput], {
|
||||
nullable: false
|
||||
})
|
||||
data!: RefreshTokenCreateManyInput[];
|
||||
|
||||
@TypeGraphQL.Field(_type => Boolean, {
|
||||
nullable: true
|
||||
})
|
||||
skipDuplicates?: boolean | undefined;
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
import * as TypeGraphQL from "type-graphql";
|
||||
import * as GraphQLScalars from "graphql-scalars";
|
||||
import { RefreshTokenCreateInput } from "../../../inputs/RefreshTokenCreateInput";
|
||||
|
||||
@TypeGraphQL.ArgsType()
|
||||
export class CreateOneRefreshTokenArgs {
|
||||
@TypeGraphQL.Field(_type => RefreshTokenCreateInput, {
|
||||
nullable: false
|
||||
})
|
||||
data!: RefreshTokenCreateInput;
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
import * as TypeGraphQL from "type-graphql";
|
||||
import * as GraphQLScalars from "graphql-scalars";
|
||||
import { RefreshTokenWhereInput } from "../../../inputs/RefreshTokenWhereInput";
|
||||
|
||||
@TypeGraphQL.ArgsType()
|
||||
export class DeleteManyRefreshTokenArgs {
|
||||
@TypeGraphQL.Field(_type => RefreshTokenWhereInput, {
|
||||
nullable: true
|
||||
})
|
||||
where?: RefreshTokenWhereInput | undefined;
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
import * as TypeGraphQL from "type-graphql";
|
||||
import * as GraphQLScalars from "graphql-scalars";
|
||||
import { RefreshTokenWhereUniqueInput } from "../../../inputs/RefreshTokenWhereUniqueInput";
|
||||
|
||||
@TypeGraphQL.ArgsType()
|
||||
export class DeleteOneRefreshTokenArgs {
|
||||
@TypeGraphQL.Field(_type => RefreshTokenWhereUniqueInput, {
|
||||
nullable: false
|
||||
})
|
||||
where!: RefreshTokenWhereUniqueInput;
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
import * as TypeGraphQL from "type-graphql";
|
||||
import * as GraphQLScalars from "graphql-scalars";
|
||||
import { RefreshTokenOrderByWithRelationInput } from "../../../inputs/RefreshTokenOrderByWithRelationInput";
|
||||
import { RefreshTokenWhereInput } from "../../../inputs/RefreshTokenWhereInput";
|
||||
import { RefreshTokenWhereUniqueInput } from "../../../inputs/RefreshTokenWhereUniqueInput";
|
||||
import { RefreshTokenScalarFieldEnum } from "../../../../enums/RefreshTokenScalarFieldEnum";
|
||||
|
||||
@TypeGraphQL.ArgsType()
|
||||
export class FindFirstRefreshTokenArgs {
|
||||
@TypeGraphQL.Field(_type => RefreshTokenWhereInput, {
|
||||
nullable: true
|
||||
})
|
||||
where?: RefreshTokenWhereInput | undefined;
|
||||
|
||||
@TypeGraphQL.Field(_type => [RefreshTokenOrderByWithRelationInput], {
|
||||
nullable: true
|
||||
})
|
||||
orderBy?: RefreshTokenOrderByWithRelationInput[] | undefined;
|
||||
|
||||
@TypeGraphQL.Field(_type => RefreshTokenWhereUniqueInput, {
|
||||
nullable: true
|
||||
})
|
||||
cursor?: RefreshTokenWhereUniqueInput | undefined;
|
||||
|
||||
@TypeGraphQL.Field(_type => TypeGraphQL.Int, {
|
||||
nullable: true
|
||||
})
|
||||
take?: number | undefined;
|
||||
|
||||
@TypeGraphQL.Field(_type => TypeGraphQL.Int, {
|
||||
nullable: true
|
||||
})
|
||||
skip?: number | undefined;
|
||||
|
||||
@TypeGraphQL.Field(_type => [RefreshTokenScalarFieldEnum], {
|
||||
nullable: true
|
||||
})
|
||||
distinct?: Array<"id" | "createdAt" | "updatedAt" | "deletedAt" | "refreshToken" | "userId"> | undefined;
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
import * as TypeGraphQL from "type-graphql";
|
||||
import * as GraphQLScalars from "graphql-scalars";
|
||||
import { RefreshTokenOrderByWithRelationInput } from "../../../inputs/RefreshTokenOrderByWithRelationInput";
|
||||
import { RefreshTokenWhereInput } from "../../../inputs/RefreshTokenWhereInput";
|
||||
import { RefreshTokenWhereUniqueInput } from "../../../inputs/RefreshTokenWhereUniqueInput";
|
||||
import { RefreshTokenScalarFieldEnum } from "../../../../enums/RefreshTokenScalarFieldEnum";
|
||||
|
||||
@TypeGraphQL.ArgsType()
|
||||
export class FindFirstRefreshTokenOrThrowArgs {
|
||||
@TypeGraphQL.Field(_type => RefreshTokenWhereInput, {
|
||||
nullable: true
|
||||
})
|
||||
where?: RefreshTokenWhereInput | undefined;
|
||||
|
||||
@TypeGraphQL.Field(_type => [RefreshTokenOrderByWithRelationInput], {
|
||||
nullable: true
|
||||
})
|
||||
orderBy?: RefreshTokenOrderByWithRelationInput[] | undefined;
|
||||
|
||||
@TypeGraphQL.Field(_type => RefreshTokenWhereUniqueInput, {
|
||||
nullable: true
|
||||
})
|
||||
cursor?: RefreshTokenWhereUniqueInput | undefined;
|
||||
|
||||
@TypeGraphQL.Field(_type => TypeGraphQL.Int, {
|
||||
nullable: true
|
||||
})
|
||||
take?: number | undefined;
|
||||
|
||||
@TypeGraphQL.Field(_type => TypeGraphQL.Int, {
|
||||
nullable: true
|
||||
})
|
||||
skip?: number | undefined;
|
||||
|
||||
@TypeGraphQL.Field(_type => [RefreshTokenScalarFieldEnum], {
|
||||
nullable: true
|
||||
})
|
||||
distinct?: Array<"id" | "createdAt" | "updatedAt" | "deletedAt" | "refreshToken" | "userId"> | undefined;
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
import * as TypeGraphQL from "type-graphql";
|
||||
import * as GraphQLScalars from "graphql-scalars";
|
||||
import { RefreshTokenOrderByWithRelationInput } from "../../../inputs/RefreshTokenOrderByWithRelationInput";
|
||||
import { RefreshTokenWhereInput } from "../../../inputs/RefreshTokenWhereInput";
|
||||
import { RefreshTokenWhereUniqueInput } from "../../../inputs/RefreshTokenWhereUniqueInput";
|
||||
import { RefreshTokenScalarFieldEnum } from "../../../../enums/RefreshTokenScalarFieldEnum";
|
||||
|
||||
@TypeGraphQL.ArgsType()
|
||||
export class FindManyRefreshTokenArgs {
|
||||
@TypeGraphQL.Field(_type => RefreshTokenWhereInput, {
|
||||
nullable: true
|
||||
})
|
||||
where?: RefreshTokenWhereInput | undefined;
|
||||
|
||||
@TypeGraphQL.Field(_type => [RefreshTokenOrderByWithRelationInput], {
|
||||
nullable: true
|
||||
})
|
||||
orderBy?: RefreshTokenOrderByWithRelationInput[] | undefined;
|
||||
|
||||
@TypeGraphQL.Field(_type => RefreshTokenWhereUniqueInput, {
|
||||
nullable: true
|
||||
})
|
||||
cursor?: RefreshTokenWhereUniqueInput | undefined;
|
||||
|
||||
@TypeGraphQL.Field(_type => TypeGraphQL.Int, {
|
||||
nullable: true
|
||||
})
|
||||
take?: number | undefined;
|
||||
|
||||
@TypeGraphQL.Field(_type => TypeGraphQL.Int, {
|
||||
nullable: true
|
||||
})
|
||||
skip?: number | undefined;
|
||||
|
||||
@TypeGraphQL.Field(_type => [RefreshTokenScalarFieldEnum], {
|
||||
nullable: true
|
||||
})
|
||||
distinct?: Array<"id" | "createdAt" | "updatedAt" | "deletedAt" | "refreshToken" | "userId"> | undefined;
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
import * as TypeGraphQL from "type-graphql";
|
||||
import * as GraphQLScalars from "graphql-scalars";
|
||||
import { RefreshTokenWhereUniqueInput } from "../../../inputs/RefreshTokenWhereUniqueInput";
|
||||
|
||||
@TypeGraphQL.ArgsType()
|
||||
export class FindUniqueRefreshTokenArgs {
|
||||
@TypeGraphQL.Field(_type => RefreshTokenWhereUniqueInput, {
|
||||
nullable: false
|
||||
})
|
||||
where!: RefreshTokenWhereUniqueInput;
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
import * as TypeGraphQL from "type-graphql";
|
||||
import * as GraphQLScalars from "graphql-scalars";
|
||||
import { RefreshTokenWhereUniqueInput } from "../../../inputs/RefreshTokenWhereUniqueInput";
|
||||
|
||||
@TypeGraphQL.ArgsType()
|
||||
export class FindUniqueRefreshTokenOrThrowArgs {
|
||||
@TypeGraphQL.Field(_type => RefreshTokenWhereUniqueInput, {
|
||||
nullable: false
|
||||
})
|
||||
where!: RefreshTokenWhereUniqueInput;
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
import * as TypeGraphQL from "type-graphql";
|
||||
import * as GraphQLScalars from "graphql-scalars";
|
||||
import { RefreshTokenOrderByWithAggregationInput } from "../../../inputs/RefreshTokenOrderByWithAggregationInput";
|
||||
import { RefreshTokenScalarWhereWithAggregatesInput } from "../../../inputs/RefreshTokenScalarWhereWithAggregatesInput";
|
||||
import { RefreshTokenWhereInput } from "../../../inputs/RefreshTokenWhereInput";
|
||||
import { RefreshTokenScalarFieldEnum } from "../../../../enums/RefreshTokenScalarFieldEnum";
|
||||
|
||||
@TypeGraphQL.ArgsType()
|
||||
export class GroupByRefreshTokenArgs {
|
||||
@TypeGraphQL.Field(_type => RefreshTokenWhereInput, {
|
||||
nullable: true
|
||||
})
|
||||
where?: RefreshTokenWhereInput | undefined;
|
||||
|
||||
@TypeGraphQL.Field(_type => [RefreshTokenOrderByWithAggregationInput], {
|
||||
nullable: true
|
||||
})
|
||||
orderBy?: RefreshTokenOrderByWithAggregationInput[] | undefined;
|
||||
|
||||
@TypeGraphQL.Field(_type => [RefreshTokenScalarFieldEnum], {
|
||||
nullable: false
|
||||
})
|
||||
by!: Array<"id" | "createdAt" | "updatedAt" | "deletedAt" | "refreshToken" | "userId">;
|
||||
|
||||
@TypeGraphQL.Field(_type => RefreshTokenScalarWhereWithAggregatesInput, {
|
||||
nullable: true
|
||||
})
|
||||
having?: RefreshTokenScalarWhereWithAggregatesInput | 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 "type-graphql";
|
||||
import * as GraphQLScalars from "graphql-scalars";
|
||||
import { RefreshTokenUpdateManyMutationInput } from "../../../inputs/RefreshTokenUpdateManyMutationInput";
|
||||
import { RefreshTokenWhereInput } from "../../../inputs/RefreshTokenWhereInput";
|
||||
|
||||
@TypeGraphQL.ArgsType()
|
||||
export class UpdateManyRefreshTokenArgs {
|
||||
@TypeGraphQL.Field(_type => RefreshTokenUpdateManyMutationInput, {
|
||||
nullable: false
|
||||
})
|
||||
data!: RefreshTokenUpdateManyMutationInput;
|
||||
|
||||
@TypeGraphQL.Field(_type => RefreshTokenWhereInput, {
|
||||
nullable: true
|
||||
})
|
||||
where?: RefreshTokenWhereInput | undefined;
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
import * as TypeGraphQL from "type-graphql";
|
||||
import * as GraphQLScalars from "graphql-scalars";
|
||||
import { RefreshTokenUpdateInput } from "../../../inputs/RefreshTokenUpdateInput";
|
||||
import { RefreshTokenWhereUniqueInput } from "../../../inputs/RefreshTokenWhereUniqueInput";
|
||||
|
||||
@TypeGraphQL.ArgsType()
|
||||
export class UpdateOneRefreshTokenArgs {
|
||||
@TypeGraphQL.Field(_type => RefreshTokenUpdateInput, {
|
||||
nullable: false
|
||||
})
|
||||
data!: RefreshTokenUpdateInput;
|
||||
|
||||
@TypeGraphQL.Field(_type => RefreshTokenWhereUniqueInput, {
|
||||
nullable: false
|
||||
})
|
||||
where!: RefreshTokenWhereUniqueInput;
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
import * as TypeGraphQL from "type-graphql";
|
||||
import * as GraphQLScalars from "graphql-scalars";
|
||||
import { RefreshTokenCreateInput } from "../../../inputs/RefreshTokenCreateInput";
|
||||
import { RefreshTokenUpdateInput } from "../../../inputs/RefreshTokenUpdateInput";
|
||||
import { RefreshTokenWhereUniqueInput } from "../../../inputs/RefreshTokenWhereUniqueInput";
|
||||
|
||||
@TypeGraphQL.ArgsType()
|
||||
export class UpsertOneRefreshTokenArgs {
|
||||
@TypeGraphQL.Field(_type => RefreshTokenWhereUniqueInput, {
|
||||
nullable: false
|
||||
})
|
||||
where!: RefreshTokenWhereUniqueInput;
|
||||
|
||||
@TypeGraphQL.Field(_type => RefreshTokenCreateInput, {
|
||||
nullable: false
|
||||
})
|
||||
create!: RefreshTokenCreateInput;
|
||||
|
||||
@TypeGraphQL.Field(_type => RefreshTokenUpdateInput, {
|
||||
nullable: false
|
||||
})
|
||||
update!: RefreshTokenUpdateInput;
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
export { AggregateRefreshTokenArgs } from "./AggregateRefreshTokenArgs";
|
||||
export { CreateManyRefreshTokenArgs } from "./CreateManyRefreshTokenArgs";
|
||||
export { CreateOneRefreshTokenArgs } from "./CreateOneRefreshTokenArgs";
|
||||
export { DeleteManyRefreshTokenArgs } from "./DeleteManyRefreshTokenArgs";
|
||||
export { DeleteOneRefreshTokenArgs } from "./DeleteOneRefreshTokenArgs";
|
||||
export { FindFirstRefreshTokenArgs } from "./FindFirstRefreshTokenArgs";
|
||||
export { FindFirstRefreshTokenOrThrowArgs } from "./FindFirstRefreshTokenOrThrowArgs";
|
||||
export { FindManyRefreshTokenArgs } from "./FindManyRefreshTokenArgs";
|
||||
export { FindUniqueRefreshTokenArgs } from "./FindUniqueRefreshTokenArgs";
|
||||
export { FindUniqueRefreshTokenOrThrowArgs } from "./FindUniqueRefreshTokenOrThrowArgs";
|
||||
export { GroupByRefreshTokenArgs } from "./GroupByRefreshTokenArgs";
|
||||
export { UpdateManyRefreshTokenArgs } from "./UpdateManyRefreshTokenArgs";
|
||||
export { UpdateOneRefreshTokenArgs } from "./UpdateOneRefreshTokenArgs";
|
||||
export { UpsertOneRefreshTokenArgs } from "./UpsertOneRefreshTokenArgs";
|
||||
@ -0,0 +1,19 @@
|
||||
import * as TypeGraphQL from "type-graphql";
|
||||
import type { GraphQLResolveInfo } from "graphql";
|
||||
import { AggregateUserArgs } from "./args/AggregateUserArgs";
|
||||
import { User } from "../../../models/User";
|
||||
import { AggregateUser } from "../../outputs/AggregateUser";
|
||||
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||
|
||||
@TypeGraphQL.Resolver(_of => User)
|
||||
export class AggregateUserResolver {
|
||||
@TypeGraphQL.Query(_returns => AggregateUser, {
|
||||
nullable: false
|
||||
})
|
||||
async aggregateUser(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: AggregateUserArgs): Promise<AggregateUser> {
|
||||
return getPrismaFromContext(ctx).user.aggregate({
|
||||
...args,
|
||||
...transformInfoIntoPrismaArgs(info),
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
import * as TypeGraphQL from "type-graphql";
|
||||
import type { GraphQLResolveInfo } from "graphql";
|
||||
import { CreateManyUserArgs } from "./args/CreateManyUserArgs";
|
||||
import { User } from "../../../models/User";
|
||||
import { AffectedRowsOutput } from "../../outputs/AffectedRowsOutput";
|
||||
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||
|
||||
@TypeGraphQL.Resolver(_of => User)
|
||||
export class CreateManyUserResolver {
|
||||
@TypeGraphQL.Mutation(_returns => AffectedRowsOutput, {
|
||||
nullable: false
|
||||
})
|
||||
async createManyUser(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: CreateManyUserArgs): Promise<AffectedRowsOutput> {
|
||||
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||
return getPrismaFromContext(ctx).user.createMany({
|
||||
...args,
|
||||
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
import * as TypeGraphQL from "type-graphql";
|
||||
import type { GraphQLResolveInfo } from "graphql";
|
||||
import { CreateOneUserArgs } from "./args/CreateOneUserArgs";
|
||||
import { User } from "../../../models/User";
|
||||
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||
|
||||
@TypeGraphQL.Resolver(_of => User)
|
||||
export class CreateOneUserResolver {
|
||||
@TypeGraphQL.Mutation(_returns => User, {
|
||||
nullable: false
|
||||
})
|
||||
async createOneUser(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: CreateOneUserArgs): Promise<User> {
|
||||
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||
return getPrismaFromContext(ctx).user.create({
|
||||
...args,
|
||||
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
import * as TypeGraphQL from "type-graphql";
|
||||
import type { GraphQLResolveInfo } from "graphql";
|
||||
import { DeleteManyUserArgs } from "./args/DeleteManyUserArgs";
|
||||
import { User } from "../../../models/User";
|
||||
import { AffectedRowsOutput } from "../../outputs/AffectedRowsOutput";
|
||||
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||
|
||||
@TypeGraphQL.Resolver(_of => User)
|
||||
export class DeleteManyUserResolver {
|
||||
@TypeGraphQL.Mutation(_returns => AffectedRowsOutput, {
|
||||
nullable: false
|
||||
})
|
||||
async deleteManyUser(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: DeleteManyUserArgs): Promise<AffectedRowsOutput> {
|
||||
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||
return getPrismaFromContext(ctx).user.deleteMany({
|
||||
...args,
|
||||
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
import * as TypeGraphQL from "type-graphql";
|
||||
import type { GraphQLResolveInfo } from "graphql";
|
||||
import { DeleteOneUserArgs } from "./args/DeleteOneUserArgs";
|
||||
import { User } from "../../../models/User";
|
||||
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||
|
||||
@TypeGraphQL.Resolver(_of => User)
|
||||
export class DeleteOneUserResolver {
|
||||
@TypeGraphQL.Mutation(_returns => User, {
|
||||
nullable: true
|
||||
})
|
||||
async deleteOneUser(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: DeleteOneUserArgs): Promise<User | null> {
|
||||
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||
return getPrismaFromContext(ctx).user.delete({
|
||||
...args,
|
||||
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
import * as TypeGraphQL from "type-graphql";
|
||||
import type { GraphQLResolveInfo } from "graphql";
|
||||
import { FindFirstUserOrThrowArgs } from "./args/FindFirstUserOrThrowArgs";
|
||||
import { User } from "../../../models/User";
|
||||
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||
|
||||
@TypeGraphQL.Resolver(_of => User)
|
||||
export class FindFirstUserOrThrowResolver {
|
||||
@TypeGraphQL.Query(_returns => User, {
|
||||
nullable: true
|
||||
})
|
||||
async findFirstUserOrThrow(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: FindFirstUserOrThrowArgs): Promise<User | null> {
|
||||
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||
return getPrismaFromContext(ctx).user.findFirstOrThrow({
|
||||
...args,
|
||||
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
import * as TypeGraphQL from "type-graphql";
|
||||
import type { GraphQLResolveInfo } from "graphql";
|
||||
import { FindFirstUserArgs } from "./args/FindFirstUserArgs";
|
||||
import { User } from "../../../models/User";
|
||||
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||
|
||||
@TypeGraphQL.Resolver(_of => User)
|
||||
export class FindFirstUserResolver {
|
||||
@TypeGraphQL.Query(_returns => User, {
|
||||
nullable: true
|
||||
})
|
||||
async findFirstUser(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: FindFirstUserArgs): Promise<User | null> {
|
||||
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||
return getPrismaFromContext(ctx).user.findFirst({
|
||||
...args,
|
||||
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
import * as TypeGraphQL from "type-graphql";
|
||||
import type { GraphQLResolveInfo } from "graphql";
|
||||
import { FindManyUserArgs } from "./args/FindManyUserArgs";
|
||||
import { User } from "../../../models/User";
|
||||
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||
|
||||
@TypeGraphQL.Resolver(_of => User)
|
||||
export class FindManyUserResolver {
|
||||
@TypeGraphQL.Query(_returns => [User], {
|
||||
nullable: false
|
||||
})
|
||||
async users(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: FindManyUserArgs): Promise<User[]> {
|
||||
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||
return getPrismaFromContext(ctx).user.findMany({
|
||||
...args,
|
||||
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
import * as TypeGraphQL from "type-graphql";
|
||||
import type { GraphQLResolveInfo } from "graphql";
|
||||
import { FindUniqueUserOrThrowArgs } from "./args/FindUniqueUserOrThrowArgs";
|
||||
import { User } from "../../../models/User";
|
||||
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||
|
||||
@TypeGraphQL.Resolver(_of => User)
|
||||
export class FindUniqueUserOrThrowResolver {
|
||||
@TypeGraphQL.Query(_returns => User, {
|
||||
nullable: true
|
||||
})
|
||||
async getUser(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: FindUniqueUserOrThrowArgs): Promise<User | null> {
|
||||
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||
return getPrismaFromContext(ctx).user.findUniqueOrThrow({
|
||||
...args,
|
||||
...(_count && transformCountFieldIntoSelectRelationsCount(_count)),
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
import * as TypeGraphQL from "type-graphql";
|
||||
import type { GraphQLResolveInfo } from "graphql";
|
||||
import { FindUniqueUserArgs } from "./args/FindUniqueUserArgs";
|
||||
import { User } from "../../../models/User";
|
||||
import { transformInfoIntoPrismaArgs, getPrismaFromContext, transformCountFieldIntoSelectRelationsCount } from "../../../helpers";
|
||||
|
||||
@TypeGraphQL.Resolver(_of => User)
|
||||
export class FindUniqueUserResolver {
|
||||
@TypeGraphQL.Query(_returns => User, {
|
||||
nullable: true
|
||||
})
|
||||
async user(@TypeGraphQL.Ctx() ctx: any, @TypeGraphQL.Info() info: GraphQLResolveInfo, @TypeGraphQL.Args() args: FindUniqueUserArgs): Promise<User | null> {
|
||||
const { _count } = transformInfoIntoPrismaArgs(info);
|
||||
return getPrismaFromContext(ctx).user.findUnique({
|
||||
...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