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

const config: CodegenConfig = {
	schema: [
		{
			'https://gql.waveapps.com/graphql/public': {
				headers: {
					Authorization: 'Bearer ' + process.env.WAVE_ACCESS_TOKEN
				}
			}
		}
	],
	documents: 'src/lib/graphql/wave/**/*.gql',
	generates: {
		'src/lib/graphql/wave/schema.graphql': {
			plugins: ['schema-ast']
		},
		'src/lib/graphql/wave/generated.ts': {
			plugins: ['typescript', 'typescript-operations', 'typescript-urql'],
			config: {
				withHooks: false,
				withComponent: false
			}
		}
	}
};

export default config;
