dotansimha / dotansimha/graphql-code-generator

[typescript-operations] generate additional type that contains all operations

Open
#10,292 0 comments 0 reactions 0 assignees View on GitHub
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 needed a single type** that contains all my operations, with their response and/or variables

Like this:
![Image](https://github.com/user-attachments/assets/5ba86ccc-0968-49fd-b737-de9ac7f9ec25)

this allows for some really cool stuff related to a projects graphql operations, heres what Im using it for:

**query key finder for react query**

![Image](https://github.com/user-attachments/assets/dda22b0f-3151-4cfc-a52c-185d25301434)

**msw wrapper, so you can write type safe and up to date mocks**

![Image](https://github.com/user-attachments/assets/f085d013-4375-4e0a-9517-e9d989371316)

I wonder if this can be useful to others and if there are more usecases!

### Describe the solution you'd like

i'm running a fork that does this, I can open a PR
https://gist.github.com/hjoelh/4b14af182d5cfd8f9ed825755b4c8ec4

### Describe alternatives you've considered

_No response_

### Any additional important details?

should it be default on? its a non breaking change so it could be
should it be an option? also works
or a seperate plugin? not sure about this one

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.