Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update codegen to use "client" preset #50

Open
michaelbromley opened this issue Sep 22, 2023 · 0 comments
Open

Update codegen to use "client" preset #50

michaelbromley opened this issue Sep 22, 2023 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@michaelbromley
Copy link
Member

Graphql codegen has a client preset plugin which has the following advantage over the current generic SDK plugin:

  • It "automatically" types the graphql operation, so it is explicit in where a particular gql document is actually being used in the app. Makes things more maintainable.
  • Less indirection in the API layer. You just pass the operation constant to a fetch function.

This task would involve:

  1. Installing the client preset per the docs
  2. Updating the codegen config
  3. In all the "providers" files, replace the gql template function with a graphql function call.
  4. Remove calls to the "sdk" object, and instead pass the query/mutation constants directly to the fetch wrapper.
@michaelbromley michaelbromley added the help wanted Extra attention is needed label Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant