Skip to content
This repository has been archived by the owner on Jun 8, 2021. It is now read-only.

Investigate creating graphql-codegen plugin #83

Closed
bugzpodder opened this issue Dec 2, 2020 · 2 comments
Closed

Investigate creating graphql-codegen plugin #83

bugzpodder opened this issue Dec 2, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@bugzpodder
Copy link

bugzpodder commented Dec 2, 2020

GraphQL codegen
is an extremely popular alternative to Apollo client's native codegen capability.
It reads graphql snippets in the source code (eg can be embedded graphql queries in tsx files) and outputs something (like a custom hook for making the query using Apollo), in our case I imagine we would be targeting typescript react hooks for RTK-query

It has a plugin-in system that allows various tools to build their own plugins. here is an example of gql typescript plugin for react-query:
https://graphql-code-generator.com/docs/plugins/typescript-react-query

@bugzpodder bugzpodder changed the title Investigate graphql-codegen plugin Investigate creating graphql-codegen plugin Dec 2, 2020
@phryneas
Copy link
Collaborator

phryneas commented Dec 2, 2020

Yup, I've already dabbled a bit with their code generation in a work project and it's pretty manageable.

This is definitely on the todo list, but it will need #52 to be done - and together with #52, I'd like to first tackle generation of clients from OpenAPI schemas, as I feel the "need" of the ecosystem is bigger there.
GraphQL codegen already does a good job for a couple of packages and while it's very cool to support it, it already supports quite a lot great tools - while for REST code generation, AFAIK there is less good choice.

If you want to take a go on this before I get to it though, feel free :)

@phryneas phryneas added the enhancement New feature or request label Dec 2, 2020
@phryneas
Copy link
Collaborator

I'm closing everything here now. If there's any need for further discussion, that should take place in a new issue over at https://github.com/reduxjs/redux-toolkit/

That said: of course a contribution in the form of such a plugin will be very welcome

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants