dotansimha / dotansimha/graphql-code-generator

Support allowEnumStringTypes in typescript-operations

Open
#7,295 2 comments 7 reactions 0 assignees View on GitHub
core
Dominant language
TypeScript
Stars
11.3k
Forks
1.4k
Avg merge
1d 1h
Merged PRs (30d)
23

Description

**Is your feature request related to a problem? Please describe.**

I'm using `allowEnumStringTypes` option to be able to use the string representation of enums in my code, but this option is not handled by typescript-operations plugin, preventing me from using the string representation of enums as variables in my operations.

**Describe the solution you'd like**
`allowEnumStringTypes` should be handled by typescript-operations to be consistent with typescript plugin.

**Describe alternatives you've considered**
None

**Additional context**
Example of generated type:
```
export type GetTargetsQueryVariables = Exact<{
id: Scalars['String'];
type: TargetType;
}>;
```

Expected generated type:
```
export type GetTargetsQueryVariables = Exact<{
id: Scalars['String'];
type: TargetType | `${TargetType}`;
}>;
```

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.