apollo-client icon indicating copy to clipboard operation
apollo-client copied to clipboard

[Testing utilities] Example with MSW

Open alessbell opened this issue 1 year ago • 1 comments

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

alessbell avatar Mar 20 '24 16:03 alessbell

@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.

alessbell avatar Mar 29 '24 14:03 alessbell

Closing as won't do since testing utilities are moving over to https://github.com/apollographql/graphql-testing-library and have MSW tests already.

alessbell avatar Jul 09 '24 15:07 alessbell

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.

github-actions[bot] avatar Jul 09 '24 15:07 github-actions[bot]

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.

github-actions[bot] avatar Aug 09 '24 00:08 github-actions[bot]