@shellicar/graphql-codegen-treeshake
v1.0.0
Published
A graphql-codegen preset that tree-shakes unused types from TypeScript output
Maintainers
Readme
@shellicar/graphql-codegen-treeshake
A graphql-codegen preset that tree-shakes unused types from TypeScript output
Installation
pnpm add -D @shellicar/graphql-codegen-treeshakeQuick Example
// codegen.ts
import { preset } from '@shellicar/graphql-codegen-treeshake';
import type { CodegenConfig } from '@graphql-codegen/cli';
const config: CodegenConfig = {
schema: 'src/**/*.graphql',
documents: ['src/**/requests.ts'],
generates: {
'src/lib/graphql/': {
preset,
presetConfig: {
fragmentMasking: false,
},
},
},
};
export default config;Documentation
For full documentation, visit the GitHub repository.
