fetchUser.ts 277 Bytes
import { Context } from "../";
import User from "entity/User";

export default async (root: {}, { id }, context: Context) => {
  const { connection } = context;
  const userRepo = connection.getRepository(User);
  const user = await userRepo.findOneById(id);
  return user;
};