dotansimha / dotansimha/graphql-code-generator-community

[typescript-vue-apollo][withCompositionFunctions] Accept readonly types for variables types

Open
#99 0 comments 4 reactions 0 assignees View on GitHub
help wanted
Dominant language
TypeScript
Stars
137
Forks
195
Avg merge
6h 20m
Merged PRs (30d)
16

Description

**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.

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.