1const fs = require('fs/promises'); 2 3const path = './src/graphql/generated.ts'; 4 5(async () => { 6 const generatedCode = await fs.readFile(path, 'utf8'); 7 const comment = `/** 8 * eslint-disable 9 * This file was generated using GraphQL Codegen 10 * Command: yarn generate-graphql-code 11 * Run this during development for automatic type generation when editing GraphQL documents 12 * For more info and docs, visit https://graphql-code-generator.com/ 13 */\n\n`; 14 15 await fs.writeFile(path, comment + generatedCode); 16})(); 17