dotansimha/graphql-code-generator-community

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

Open

#102 建立於 2020年12月21日

在 GitHub 查看
 (1 留言) (1 反應) (0 負責人)TypeScript (195 fork)github user discovery
help wanted

倉庫指標

Star
 (136 star)
PR 合併指標
 (PR 指標待抓取)

描述

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:

  • my-query.graphl => my-query.generated.ts // produces types via typescript-operations (done!)
  • my-query.graphl => my-query.hook.generated.ts // produces query hook locally, auto mapping IO/types into the hook

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.

貢獻者指南