import type { CodegenConfig } from '@graphql-codegen/cli'

const config: CodegenConfig = {
  schema: '../backend/src/main/resources/graphql/schema.graphqls',
  documents: ['src/shared/api/graphql/operations/**/*.{ts,tsx,graphql}'],
  generates: {
    'src/shared/api/graphql/generated/': {
      preset: 'client',
      presetConfig: {
        fragmentMasking: false,
      },
      config: {
        useTypeImports: true,
        scalars: {
          Date: 'string',
          DateTime: 'string',
          Long: 'number',
        },
      },
    },
  },
}

export default config
