29 lines
747 B
TypeScript
29 lines
747 B
TypeScript
import { objectType, inputObjectType } from "nexus";
|
|
import * as nPrisma from "nexus-prisma";
|
|
|
|
import { Role } from "./role";
|
|
|
|
export const User = objectType({
|
|
name: nPrisma.User.$name,
|
|
definition(t) {
|
|
t.field(nPrisma.User.id);
|
|
t.field(nPrisma.User.firstname);
|
|
t.field(nPrisma.User.lastname);
|
|
t.field(nPrisma.User.email);
|
|
t.field(nPrisma.User.role);
|
|
t.field(nPrisma.User.blocked);
|
|
},
|
|
});
|
|
|
|
export const UserCreateInput = inputObjectType({
|
|
name: "UserCreateInput",
|
|
definition(t) {
|
|
t.nonNull.string("firstname");
|
|
t.nonNull.string("lastname");
|
|
t.nonNull.string("email");
|
|
t.nonNull.string("password");
|
|
t.nonNull.field("role", { type: Role });
|
|
t.boolean("blocked", { default: false });
|
|
},
|
|
});
|