-

Amsterdam, Netherlands
Back to Schedule

Alessia Bellisario

Schema-Driven Testing with Mock Service Worker

Skyline A - Level 21
GraphQL ClientSession Presentations

Session description

At last year’s GraphQL Conf, Stephanie Saunders sang the praises of schema mocking in her excellent talk “Sophisticated Schema Mocking”. As Stephanie outlined, tests written using mock schemas have several benefits over ones written with static response mocks (seriously, go back and watch the talk if you haven’t!) Mock schemas are the perfect pair for Mock Service Worker which describes itself as “an API mocking library that allows you to write client-agnostic mocks and reuse them across any frameworks, tools, and environments.” In this talk, I’ll demonstrate how to use mock schemas with MSW using testing tools created by the Apollo Client team. These utilities can be used with any GraphQL client for the web whether it’s Apollo Client, Relay, urql, isograph or even just plain fetch requests to a GraphQL endpoint, and support incremental delivery (@defer/@stream), subscriptions and more. With MSW + your front-end stack of choice + test runner or framework of choice (Jest, Puppeteer, Cypress, Storybook, the list goes on) this talk will teach you how to level up the tests you and your team are writing.


Session speakers

Alessia Bellisario

Staff Software Engineer, Apollo

GraphQL Clientsreturning speaker

Alessia is a Staff Open Source Engineer at Apollo GraphQL building Apollo Client. She loves ECMAScript, making generative art with pen plotters and lives in New York City with her wife and son.


Session resources

Get your ticket

Join three transformative days of expert insights and innovation to shape the next decade of APIs!

Get tickets
COMMUNITYDEVELOPER EXPERIENCEAPIsTOOLS & LIBRARIESCOMMUNITYDEVELOPER EXPERIENCEAPIsTOOLS & LIBRARIES
OPEN SOURCEFEDERATIONECOSYSTEMSTRACING & OBSERVABILITYOPEN SOURCEFEDERATIONECOSYSTEMSTRACING & OBSERVABILITY
BEST PRACTICESWORKSHOPSSCHEMASSECURITYBEST PRACTICESWORKSHOPSSCHEMASSECURITY