@@ -2,7 +2,7 @@ import { CodegenConfig } from '@graphql-codegen/cli'
22
33const 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