dotansimha / dotansimha/graphql-code-generator-community
[typescript-apollo-client-helpers] generated FieldPolicy type definitions
- Dominant language
- TypeScript
- Stars
- 137
- Forks
- 195
- Avg merge
- 6h 20m
- Merged PRs (30d)
- 16
Description
I added typescript-apollo-client-helpers to generate a typesafe `StrictTypedTypePolicies`. Looking at the generated FieldPolicy declarations for each entity type, I see they're all FieldPolicy, so when doing something like:
```
typePolicies: {
User: {
fields: {
displayName(existing) {
return existing;
},
},
},
}
```
The `existing` prop is of course `any` because of the generated FieldPolicy:
```
export type UserFieldPolicy = {
displayName?: FieldPolicy | FieldReadFunction,
};
```
I'm wondering if it's possible to - when used in tandem with the [Typescript](https://www.graphql-code-generator.com/plugins/typescript) plugin - have these `any`s replaced with the fields actual type definitions, which in my case looks like:
```
export type User = {
displayName: Maybe;
};
```
Thanks!
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.