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

refactor(react): consume new action plans from api client #632

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

danroberts
Copy link
Contributor

@danroberts danroberts commented Sep 5, 2024

We want to remove the dependency from @gadgetinc/react -> api-client-core, because it's really easy to end up with multiple incompatible versions of api client core installed.

A main reason for the dependency is that @gadgetinc/react needs to access the operationBuilder functions in order to create query plans to pass to urql in hooks.

This PR attaches the plan builder functions as part of the action function prototype, alongside the other metadata about the action that is already present in the prototype.

This PR is a chain, currently consisting of:

This change to js-clients to introduce the plan to the types
This change to add the plan functions to the client instance when building it: https://github.com/gadget-inc/gadget/pull/12843
This PR: having the react hooks consume these plans rather than import them from the api-client-core lib

@danroberts danroberts changed the title Droberts/action plans react refactor(react): consume new action plans from api client Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant