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
6 changes: 3 additions & 3 deletions frontend/graphql-codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { CodegenConfig } from '@graphql-codegen/cli'

const PUBLIC_API_URL = process.env.PUBLIC_API_URL || 'http://localhost:8000'

export default (async (): Promise<CodegenConfig> => {
export default async function getCodegenConfig(): Promise<CodegenConfig> {
let response

try {
Expand All @@ -12,7 +12,7 @@ export default (async (): Promise<CodegenConfig> => {
} catch {
/* eslint-disable no-console */
console.log('Failed to fetch CSRF token: make sure the backend is running.')
return
throw new Error('Failed to fetch CSRF token: make sure the backend is running.')
}

if (!response.ok) {
Expand Down Expand Up @@ -74,4 +74,4 @@ export default (async (): Promise<CodegenConfig> => {
},
},
}
})()
}