This repository has been archived by the owner on Apr 13, 2023. It is now read-only.
Fix Regression where variables passed in graphql HOC options were not merged with mutation variables #2216
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.
Prior to 2.0, variables passed in via the graphql HOC were merged with the variables passed into the mutation function directly. After 2.0, this no longer happens and variables included within the graphql HOC are dropped. This resulted in a breaking change for my app as we use this pattern consistently across the codebase.
Here's an example:
In this example, the mutation would only receive the variable
second: 2
and fail to incorporate the variablefirst: 1
. If you do not include any variables within the mutate call (just callmutate()
), thenfirst: 1
is successfully included, but when including any variables within mutate, they are overwritten rather than merged. This PR reverts that behavior to where they will be merged together.I've included a test to test for this scenario as well.
Checklist: