[typescript-vue-apollo][withCompositionFunctions] Accept readonly types for variables types
#99 创建于 2020年12月15日
仓库指标
- Star
- (136 star)
- PR 合并指标
- (PR 指标待抓取)
描述
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.