Intercept and Mock GraphQL Queries in MSW

Share this video with your friends

Send Tweet

Let's spice things up by adding GraphQL to our application.

Since you are prototyping mock-first, you don't have to write any GraphQL schemas or define any resolvers. Instead, you will utilize Mock Service Worker to intercept valid GraphQL queries by their type and name, and respond with the same semantic JSON responses matching the queries.