dotansimha / graphql-code-generator-community

MIT License
118 stars 155 forks source link

rfc: react-query hooks with near-operation-file -like generation #102

Open cdaringe opened 3 years ago

cdaringe commented 3 years ago

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

n/a

Describe the solution you'd like

cc/ @dotansimha

the react-query plugin is a great idea. however, it's not tailored to my current workflow.

desired outcomes:

This is different than the status quo, where logic is bundled in a types+operations-types+logic file. The fetcher could still be shared via import mapping. Additionally, a thunk should be consider for providing endpoint datas, such that config can be provided by the application, vs the generation tool.

Describe alternatives you've considered

Living w/ the status quo impl.

Additional context

By isolating operations hooks, I can shave bundle sizes, and also have a more narrow focus when inspecting my queries.

dotansimha commented 3 years ago

Thank you @cdaringe , I don't see a reason for this not to work, maybe it just needs some adjustments. Btw, we've just released v1 of the plugin with react-query v3 support ;)