INNER CODE UNIT · JavaScript
run
hygraph/hygraph-examples · using-asset-upload/src/index.js:25
const run = async () => {
try {
const [, , file] = process.argv;
if (!file) throw new Error('Missing `file` arguement');
let data;
try {
const rawdata = fs.readFileSync(file);
data = JSON.parse(rawdata);
} catch (error) {
throw new Error(error);
}
const importQueue = new Queue('Hygraph Asset Import', {
activateDelayedJobs: true,