apollo-client
apollo-client copied to clipboard
[Testing utilities] Example with MSW
Issue Description
Build an example of using proxiedSchema with Mock Service Worker using react-apollo-error-template.
Link to Reproduction
N/A
Reproduction Steps
No response
@apollo/client version
N/A
@jerelmiller and I had an interesting discovery related to some MSW tests yesterday in which several tests are sharing a client instance: the SuspenseCache was causing tests running serially using the same query in subsequent tests to do an initial render with the old data from the resolvers set in the previous test.
This is due to a setTimeout in the dispose function to work around an issue with strict mode. Jerel had an idea about how we may be able to remove the setTimeout since some of the logic around unsubscribing/resubscribing changed with the introduction of createQueryPreloader.
Closing as won't do since testing utilities are moving over to https://github.com/apollographql/graphql-testing-library and have MSW tests already.
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Client usage and allow us to serve you better.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. For general questions, we recommend using StackOverflow or our discord server.