Course lesson

Resolve GraphQL Requests Against a Mock Schema in MSW

Operation-based GraphQL mocking allows you to move fast without investing time into schemas or resolvers.

Duration
3 min
Access
Free
Transcript
Retained from source evidence

Operation-based GraphQL mocking allows you to move fast without investing time into schemas or resolvers.

But, when integrating Mock Service Worker into an existing application, going schema-first can be advantageous. Here's how you can route every GraphQL request to be resolved against a GraphQL schema, mocked or real, and use mock resolvers to control individual types and fields.