[typescript-vue-apollo][withCompositionFunctions] Accept readonly types for variables types
#99 geöffnet am 15. Dez. 2020
Repository-Metriken
- Stars
- (136 Stars)
- PR-Merge-Metriken
- (PR-Metriken ausstehend)
Beschreibung
Is your feature request related to a problem? Please describe.
We use the composition functions generated with typescript-vue-apollo with withCompositionFunctions config flag. We also use readonly types in parts of the codebase.
Currently, when we want to feed a readonly type as a variable to such generated composition function, we have to cast it or otherwise copy readonly types to mutable types, because the composition function's type expects mutable values.
Describe the solution you'd like
Preferably, the generated useQuery composition functions would accept both readonly and mutable types as variables and options props, as the assumption is that VueApolloComposable.useQuery should not mutate those values.
Describe alternatives you've considered
Currently, we have to cast the readonly values to mutable types when feeding them to the generated useQuery function, otherwise TypeScript raises error.