Prevent passing custom QueryClient instance to ServicesContext #10913
Open
Labels
kind/chore
quality/code
Violations from current rules for code, best practices, etc. Or just bad code.
quality/testing
Tests that are missing, needs to be created or could be improved.
status/triage
Description
It's currently possible to pass a custom
QueryClient
instance toServicesContext
. This should not be allowed as it enables bypassing the error handling mechanism set inQueryCache
andMutationCache
.The main challenge in resolving this task is that several of our tests use the
setQueryData
method ofQueryClient
. We may need to replace them withwaitForData
methods, as we have done in several other tests, but not sure if it's the best solution.Another solution could be to retrieve the
QueryClient
instance using theuseQueryClient
hook when passing the component to test, but this might make the code less readable.The text was updated successfully, but these errors were encountered: