Sophisticated Schema Mocking Stephanie Saunders, Coinbase
Sophisticated Schema Mocking Stephanie Saunders, Coinbase One of the key components to a stellar developer experience is GraphQL schema mocking. Schema mocking allows developers to: - Develop features faster by mocking unit tests with little to no code - Simplify e2e testing by mocking the entire schema at the network level - Test client data handling by intercepting and modifying server responses at the field level - Visualize how your component will look in production by using mocked data directly in Storybook At Coinbase, we have iterated over sophisticated schema mocking solutions over the last few years as we have migrated to GraphQL. We’ve had failures and successes, and lots of learning along the way. In this talk, we’ll dive deep into the following topics: - Out-Of-The-Box Tooling (Nock, MSW, Relay MockPayloadGenerator, graphql-tools/mock) - Custom Helpers (Operation Mocking, Data Component Wrappers, Network Middleware) - Client Side Data Manipulation (Mocking Single Fields, Client Schema Extensions) - Storybook (Loading Live/Mocked Data, Update Field Mocks Dynamically) GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. GraphQL provides a complete and understandable description of the data in your API, gives clients the power to ask for exactly what they need and nothing more, makes it easier to evolve APIs over time, and enables powerful developer tools. Get Started Here: https://graphql.org/