[client-preset] Reason for config restrictions on client-preset
#8993
Replies: 5 comments 5 replies
-
We are happy to re-introduce specific configuration options given there is a use-case. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
FWIW I've been using this yarn patch and it has worked well for me:
diff --git a/cjs/index.js b/cjs/index.js
index 8424b6a11586092665872ab1e190b57602efe44b..9e6f342e1fe583a40863b029db887fdd95c1f360 100644
--- a/cjs/index.js
+++ b/cjs/index.js
@@ -182,7 +182,7 @@ exports.preset = {
schema: options.schema,
config: {
inlineFragmentTypes: isMaskingFragments ? 'mask' : options.config['inlineFragmentTypes'],
- ...forwardedConfig,
+ ...options.config,
},
documents: sources,
documentTransforms: options.documentTransforms,
diff --git a/esm/index.js b/esm/index.js
index be26a67a1b827896d16813b22b9a45aec5ac5586..c7cb26b337ef39b4270aff021cfe9ccb148e0848 100644
--- a/esm/index.js
+++ b/esm/index.js
@@ -177,7 +177,7 @@ export const preset = {
schema: options.schema,
config: {
inlineFragmentTypes: isMaskingFragments ? 'mask' : options.config['inlineFragmentTypes'],
- ...forwardedConfig,
+ ...options.config,
},
documents: sources,
documentTransforms: options.documentTransforms, Just be careful not to set anything that breaks the preset |
Beta Was this translation helpful? Give feedback.
-
They recommend |
Beta Was this translation helpful? Give feedback.
-
For what it's work I have been using the following configs that are not exposed by Client Preset for almost a year now without issue: enumsAsConst: true,
immutableTypes: true,
enumValues: {
...
}, enumValues is especially useful to use my common library's exported enums rather than duplicating them |
Beta Was this translation helpful? Give feedback.
-
Found this code in the
@graphql-codegen
build.The docs specified the configs supported for
client-preset
, I just wanted to make sure.There are a lot of useful configs that I need to use in my current project, and these doesn't suffice.
May I know the rationale behind the restriction of the other config options?
Beta Was this translation helpful? Give feedback.
All reactions