Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions packages/executors/http/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {
createResultForAbort,
hashSHA256,
} from './utils.js';
import * as fs from 'fs';

export type SyncFetchFn = (
url: string,
Expand Down Expand Up @@ -439,6 +440,14 @@ export function buildHTTPExecutor(
}
return parsedResult;
} catch (e: any) {
const currentTime = new Date().toISOString().replace(/[-:Z]/g, '');
const logDir = `tmp/codegen`;
const logFile = `${logDir}/${currentTime}_graphql_codegen_response.log`;
if (!fs.existsSync(logDir)) {
fs.mkdirSync(logDir, { recursive: true });
}
console.log(`Writing response to ${logFile}`);
fs.writeFileSync(logFile, result);
return {
errors: [
createGraphQLError(
Expand Down