refactor(react): consume new action plans from api client #632
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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