Back to Blog
Rom frontend database api5/30/2023 ![]() This probably is not the intended use for MockedProvider, as the Apollo documentation only covers implementing it in the context of a test environment. How does this help? The idea came to me one day while I was writing unit tests - if the MockedProvider could be used to hydrate my React App in the test environment JSDOM, then why not in the browser DOM? ![]() Luckily, Apollo Client ships with MockedProvider, a component that allows you to test your React components by mocking calls to your GraphQL endpoint. You could just hard code the templates and leave the integration until later, or import a JSON file of mock data to use, but neither of these solutions are particularly efficient as they don’t allow you to see the result of the actual code that will run in production.Įven if your backend API is ready and you have a local development environment to work with, configuring your application and populating your database can be a laborious process. ![]() If you’re a frontend developer, you’ve probably experienced being blocked while waiting on the backend API to be built.
0 Comments
Read More
Leave a Reply. |