I would like to be able to exclude *Input types from being immutable.
I like to be able to use the immutableTypes feature, as I think most of the types there should be treated as immutables.
However, I want to be able to gradually build the input objects, so I want to exclude those.
A solution could be being able to configure:
Hi @yoavain-sundaysky ! Thank you for reporting this issue.
You are right, at the moment the immutable configuration can only be turned on/off and is not configurable.
We can give it a try in the future and add it (And we always welcome PRs).
may be an option to just have the results from queries and mutations to be immutable instead of the types themself would be a nice option as well.
Woudnt it be better to be able to override all options based on some name or type pattern. Something like.
generates:
path/to/file.ts:
plugins:
- typescript
- typescript-operations
config:
avoidOptionals: true
immutableTypes: true
configByKind:
input:
immutableTypes: false
configByName:
*Input:
avoidOptionals: false
This would allow to customize the generation a lot.
@lanwin this sounds like a nice idea, but I worry that it might make the implementation much more complex than today.
Do you have more uses cases that it can enhance? maybe you can open an issue for this with examples?
Thank you!