Skip to content

Commit a239467

Browse files
Update code
1 parent 09b8ca5 commit a239467

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

frontend/graphql-codegen.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { CodegenConfig } from '@graphql-codegen/cli'
22

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

5-
const createCodegenConfig = async (): Promise<CodegenConfig> => {
5+
export default (async (): Promise<CodegenConfig> => {
66
const response = await fetch(`${PUBLIC_API_URL}/csrf/`, {
77
method: 'GET',
88
})
@@ -14,7 +14,7 @@ const createCodegenConfig = async (): Promise<CodegenConfig> => {
1414
const csrfToken = data.csrftoken
1515

1616
return {
17-
documents: ['src/**/*.{ts,tsx}'],
17+
documents: ['src/**/*.{ts,tsx}', '!src/types/__generated__/**'],
1818
generates: {
1919
'./src/': {
2020
config: {
@@ -33,7 +33,7 @@ const createCodegenConfig = async (): Promise<CodegenConfig> => {
3333
skipTypeNameForRoot: true,
3434
},
3535
// Order of plugins matter
36-
plugins: ['typescript-operations', 'typed-document-node'],
36+
plugins: ['typescript-operations', 'typed-document-node'],
3737
preset: 'near-operation-file',
3838
presetConfig: {
3939
// This should be the file generated by the "typescript" plugin above,
@@ -59,6 +59,4 @@ const createCodegenConfig = async (): Promise<CodegenConfig> => {
5959
},
6060
},
6161
}
62-
}
63-
64-
export default await createCodegenConfig()
62+
})()

0 commit comments

Comments
 (0)