dotansimha / dotansimha/graphql-code-generator
Generate only queries or only mutations
- 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 am trying to use a different fetcher for queries and mutations. Perhaps this is a more that I am trying to solve my problem in the wrong way, although still it would be nice to be able to generate _only_ queries or _only_ mutations.
**Describe the solution you'd like**
I would imagine it would be a configurable option in the config that takes "queries" or "mutations".
```yaml
documents: src/**/*.graphql
generates:
src/generated/queries.ts:
plugins:
- typescript
- typescript-operations
- typescript-react-query
config:
fetcher: "../codegen.fetcher#queryFetcher"
generate: "queries"
src/generated/mutations.ts:
plugins:
- typescript
- typescript-operations
- typescript-react-query
config:
fetcher: "../codegen.fetcher#mutationFetcher"
generate: "mutations"
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.