Files
2025-08-02 16:30:27 +02:00

30 lines
1.1 KiB
TypeScript

import { CodegenConfig } from '@graphql-codegen/cli';
import * as path from 'path';
const pattern = '{js-shop,js-menu,js-multisets,interfaces/fragments,filters}/**/*.{tsx,ts}';
const componentsPattern = 'bundles/KupShop/ComponentsBundle/Resources/views/**/*.{tsx,ts}';
const componentsDocuments = path.join(__dirname, '../../../../../../', componentsPattern);
const graphqlPattern = 'bundles/KupShop/GraphQLBundle/Api*/**/*.{php}';
const config: CodegenConfig = {
schema: 'https://www.kupshop.local/graphql',
ignoreNoDocuments: true,
config: {
namingConvention: path.join(__dirname, 'GraphQLNamingConvention'),
},
generates: {
[path.join(__dirname, '../../interfaces/gqlApi/')]: {
preset: 'client',
presetConfig: {
fragmentMasking: false
},
documents: [path.join(__dirname, '../../', pattern), path.resolve(componentsDocuments)],
watchPattern: [path.join('web/common/webpack/assets/', pattern), path.resolve(componentsPattern), path.resolve(graphqlPattern)],
}
}
};
export default config;