Using GraphQL SDL files as executable API Contracts
summary
Uses GraphQL SDL files as executable API contracts with Specmatic to auto‑generate contract tests, mocks and backward‑compatibility checks; demos run from CLI, Kotlin/Spring Boot and React/Apollo. One SDL yields three basic tests then expands to 73 tests when resiliency and negative cases are enabled, catching a data corruption bug where a non‑null field was accepted as null. Central Git repo of SDLs prevents divergence and a loop test for backward compatibility compares v1/v2 to flag contractions; mocking supports fault simulation (delays) and the generated tests run in CI.
AI-written summary · about
chapters (12)
- 0:00GraphQL SDL as contracts
- 3:58Mock-based GraphQL API problems
- 8:48Contract testing demo
- 12:20Detecting API deviations
- 14:29Resiliency testing with mutations
- 18:47Contract repository for versioning
- 19:10GraphQL SDL for service virtualization
- 23:23Fault simulation with mock servers
- 26:55Front-end testing with GraphQL mocks
- 27:58Backward compatibility testing
- 32:35Contract-driven development
- 37:10Shift-left testing benefits
related talks
22mA Mock Is a Promise: Making GraphQL Mocks Enforceable
16mHow I Started Mocking My GraphQL Schema
24mGoing GraphQL
23mIntroducing Tartiflette GraphQL Engine: "SDL first" implementation built
33mSchema First, Code First, or Both? Adopting Schema First Development
01h 04mBuilding real-time API's with GraphQL
27mGraphQL: Towards a universal query language
33m6 Years of Distributed GraphQL in Production
