be evolved independently • This is one goal of microservices architecture • We often want to make changes for APIs • explicitly or implicitly • All the changes possibly break the consumers using that service
• Ask to other teams manually • It's necessary, but we want to reduce it as much as possible • Use Contracts between Consumer and Provider • (c.f. Consumer-driven Contract Testing) • Check Production API Logs
queries before they use them (e.g. build steps) • Benefits: • Avoid executing unknown queries (which can be harmful) in provider service • Reduce the size of request payload • Enable to use HTTP GET Method, and cache on CDN
• Provider can check the persisted queries, and know what kind of fields are being used now • Provider can write tests to assure these queries can be used correctly, and run them in CI (≒ Consumer-driven Contract Testing)
our teams loose-coupling • It's also important that API documentation is always new and valid • It should be declarative and be used for request/response validation
perfectly works • Compare to OpenAPI, GraphQL Type system is tightly coupled with the actual implementation • OpenAPI itself is just a declarative documentation • To validate request and response, we need some other tool (e.g. interagent/committee is an implementation for Ruby)
REST/gRPC and GraphQL • Mapping REST/gRPC API to GraphQL Type is not just annoying, but also increasing points of failure • I feel it's usually a bit excessive architecture • (Sorry, I know google/rejoiner but didn't try by my hand)
because • It makes easy to evolve our services without breaking consumers • It provides good API type and documentation system • It makes easy to make GraphQL Aggregation Layer for Frontend (which is already thought to be very useful)