Skip to content

Conversation

@boschni
Copy link
Collaborator

@boschni boschni commented Aug 14, 2020

The current config merging looked a bit confusing so I tried to simplify this a bit and to define a formal strategy:

When using hooks the config will be merged in the following order:

  1. Defaults.
  2. Defaults from the hook query cache.
  3. Combined defaults from any config providers in the tree.
  4. Query/mutation config provided to the hook.

When using a query cache directly the config will be merged in the following order:

  1. Defaults.
  2. Defaults from the query cache.
  3. Query/mutation config provided to the query cache method.

@vercel
Copy link

vercel bot commented Aug 14, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/tannerlinsley/react-query/7z175ah5b
✅ Preview: https://react-query-git-fork-boschni-feature-config-merging.tannerlinsley.vercel.app

@boschni boschni force-pushed the feature/config-merging branch from 3b2d35f to 9d71586 Compare August 14, 2020 20:34
@boschni boschni force-pushed the feature/config-merging branch from 9d71586 to b8bcabf Compare August 14, 2020 20:36
@vercel vercel bot temporarily deployed to Preview August 14, 2020 20:36 Inactive
@boschni boschni force-pushed the feature/config-merging branch from b8bcabf to 0f6d697 Compare August 14, 2020 20:36
@boschni boschni force-pushed the feature/config-merging branch from 0f6d697 to 4f80fd3 Compare August 15, 2020 07:52
@boschni boschni force-pushed the feature/config-merging branch from 4f80fd3 to 82767c3 Compare August 19, 2020 20:17
@boschni boschni force-pushed the feature/config-merging branch from 82767c3 to a94fc97 Compare August 19, 2020 20:33
@boschni boschni force-pushed the feature/config-merging branch from a94fc97 to d86f8e9 Compare August 19, 2020 20:37
@vercel vercel bot temporarily deployed to Preview August 19, 2020 20:37 Inactive
@boschni boschni force-pushed the feature/config-merging branch from d86f8e9 to d26d95c Compare August 19, 2020 20:38
@boschni boschni force-pushed the feature/config-merging branch from d26d95c to 718c552 Compare August 19, 2020 20:43
@vercel vercel bot temporarily deployed to Preview August 19, 2020 20:43 Inactive
@boschni boschni force-pushed the feature/config-merging branch from 718c552 to e9ad2fb Compare August 19, 2020 20:45
@tannerlinsley
Copy link
Member

Ready?

@boschni
Copy link
Collaborator Author

boschni commented Aug 20, 2020

Yes this one is ready to be merged

@tannerlinsley tannerlinsley merged commit 4314ba5 into TanStack:master Aug 20, 2020
@tannerlinsley
Copy link
Member

🎉 This PR is included in version 2.7.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants