fetchContract.ts 305 Bytes
import { Context } from "../";
import Contract from "entity/Contract";

export default async (root: {}, { id }, context: Context) => {
  const { connection } = context;
  const contractRepo = connection.getRepository(Contract);
  const contract = await contractRepo.findOneById(id);
  return contract;
};