April 2022 Summaries
5 posts from Apollo
Filter
Month:
Year:
Post Summaries
Back to Blog
The story behind Apollo Kotlin 3 codegen is a complex and nuanced one, with multiple tradeoffs involved. The release of Apollo Kotlin 3 in December 2021 marked a significant milestone for the project, but it also presented several challenges. The initial goal was to generate type-safe models from GraphQL operations, but this proved to be more complicated than expected. After exploring different approaches, including mapping GraphQL types to Kotlin interfaces and generating classes based on operations, the team decided to implement a new codegen system that takes into account the complexities of fragments and nested fields. This response-based codegen offers several benefits, including the ability to stream JSON responses, store merged fields only once, and allow polymorphism. However, it also presents challenges, such as exponentially growing codegen and name clashes due to limitations on file names. Ultimately, the choice between operation-based and response-based codegen depends on the specific needs of each project, with operation-based being more compatible with 2.x and easier to grasp, but offering less type information and performance.
Apr 26, 2022
2,386 words in the original blog post.
A federated schema design is a type of GraphQL schema that's designed to be extensible, maintainable, and adaptable to changing requirements. It's built around the concept of a "supergraph," which is a next-generation API gateway capable of encapsulating all the capabilities across multiple products and services. The supergraph is composed of smaller subgraphs, each representing a specific domain or subdomain, and are designed to be independent and reusable. The design principles for a federated schema include thinking in entities, using domain-oriented thinking, making collaboration strategy explicit, and using a subgraph-focused workflow. These principles help ensure that the schema is well-structured, maintainable, and adaptable to changing requirements, allowing developers to build scalable and flexible applications.
Apr 20, 2022
2,796 words in the original blog post.
The text discusses the concept of a federated architecture in GraphQL, which involves combining multiple subgraphs into a single supergraph. A federated architecture is beneficial for large organizations or projects with multiple teams, as it allows each team to work independently on their respective subgraphs while still maintaining relationships between them through metadata defined in the schema. This approach eliminates the need for handwritten code to "glue" together multiple GraphQL microservices and enables scaling of individual subgraphs independently. The text also highlights the benefits of a federated architecture, including increased productivity and collaboration among teams, reduced breaking changes and communication, and simplified development processes.
Apr 15, 2022
1,784 words in the original blog post.
Apollo Federation is a developer-friendly path to GraphQL microservices for any project, allowing you to elevate your graph from just another API to a platform that exposes the value of your product. Building a graph can feel daunting, but Apollo Federation provides a thin open-sourced specification that makes it possible to modularize your graph into smaller parts using entities and subgraphs. The series aims to help you overcome common challenges devs face when designing, building, and scaling federation in the wild, covering questions such as what is a supergraph and how to deploy a federated graph with proper security for subgraphs. To get started, it's recommended to walk through the getting started guide for Apollo Server and take the Lift-off course in Odyssey, before checking out the posts from the series in order.
Apr 15, 2022
358 words in the original blog post.
The Apollo Federation 2 is now generally available, with improvements across the entire Apollo platform, including Gateway 2.0, the Rover CLI, and Apollo Studio. The new version builds on the success of the original with an improved shared ownership model, enhanced type merging, and cleaner syntax for a smoother developer experience. It adds first-class support for shared interfaces, enums, and other value types, making it easier to reuse common value types like interfaces and enums across subgraphs. Federation 2 also improves upon the shared ownership model, making shared types more flexible and allowing smaller incremental changes without downtime or coordinated delivery. Additionally, it includes deeper static analysis, better error messages, and a new generalized composition model that helps catch errors at build-time instead of at runtime.
Apr 13, 2022
846 words in the original blog post.