dotansimha / dotansimha/graphql-code-generator
support import typesPath config for gql-tag-operations-preset
- 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 have a monorepo project that uses different codegen plugins. They use the `import-types` preset to deduplicate the output from the `typescript` plugin, so each package just has its own operations.
Recently I've been trying to use gql-tag-operations preset, but it internally uses the `typescript` plugin and creates duplicate base types.
**Describe the solution you'd like**
Add options to the `gql-tag-operations-preset`package so it can work similarly to the `import-types` preset.
**Describe alternatives you've considered**
- Running `gql-tag-operations` as a plugin directly, not as the preset. This is problematic because of how it expects inputs (pre-processing that the preset handles in [`processSources`](https://github.com/dotansimha/graphql-code-generator/blob/0b80485be354a3ac33e21e6f414249cf29ea9abb/packages/presets/gql-tag-operations/src/process-sources.ts#L7)
- Moving the `processSources` util fn from the preset, to the plugin. In this way, `gql-tag-operations-preset` wouldn't really be needed anymore, and it'd be up to the user to specify the plugins.
- I think this might be the more "proper" solution but the first one is definitely easier to implement.
**Additional context**
n/a
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.