Fix graphql queries
This commit is contained in:
+19
@@ -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)),
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user