User.js 364 Bytes
import { prisma } from "../../utils";

export default {
  User: {
    groups: (parent) =>
      prisma.user.findOne({ where: { id: parent.id } }).groups(),
    messages: (parent) =>
      prisma.user.findOne({ where: { id: parent.id } }).messages(),
    directMessages: (parent) =>
      prisma.user.findOne({ where: { id: parent.id } }).directMessages(),
  },
};