import { makeWorkerUtils, WorkerUtils } from "graphile-worker";

let workerUtils: WorkerUtils;

export const getWorkerUtils = async () => {
  if (!workerUtils) {
    workerUtils = await makeWorkerUtils({
      connectionString: process.env.DATABASE_URL,
    });
  }

  return workerUtils;
};
