dotansimha / dotansimha/graphql-code-generator

[client-preset] allowed options and defaults

Open
#8,562 43 comments 9 reactions 1 assignee Claimed by @charlypoly View on GitHub
feature-request help wanted
Dominant language
TypeScript
Stars
11.3k
Forks
1.4k
Avg merge
1d 1h
Merged PRs (30d)
23

Description

This issue is the place to discuss allowed options and default values when using the `preset: 'client'` setup.

## Currently supported options

- `scalars`
- `strictScalars`
- `namingConvention`
- `useTypeImports`
- `skipTypename`
- `enumsAsTypes`
- `arrayInputCoercion`
- `presetConfig.fragmentMasking`
- `presetConfig.gqlTagName`
- `presetConfig.unmaskFunctionName`
- `emitLegacyCommonJSImports`

## Requested options support
- `nonOptionalTypename` https://github.com/dotansimha/graphql-code-generator/pull/8702 - [Request](https://github.com/dotansimha/graphql-code-generator/issues/8296#issuecomment-1287010974)
- `immutableTypes` https://github.com/dotansimha/graphql-code-generator/pull/10459 - [Request](https://github.com/dotansimha/graphql-code-generator/issues/8296#issuecomment-1287010974)

## Current defaults
- `presetConfig.fragmentMasking: true`
- `inlineFragmentTypes: true` (if fragment masking is enabled)
- `emitLegacyCommonJSImports: true`
- `inputMaybeValue: T | null | undefined`

## Requested defaults
- `ignoreNoDocuments: true` (@charlypoly)
- should `presetConfig.fragmentMasking` be `false` by default? (@charlypoly)
- `dedupeFragments: true` (https://github.com/dotansimha/graphql-code-generator/issues/8103#issuecomment-1298692748)
- `enumsAsTypes: true` (@n1ru4l)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.