Company
Date Published
Author
Jens Neuse
Word count
3270
Language
English
Hacker News points
1

Summary

The Cosmo Router is a GraphQL API Gateway that routes requests from clients to Subgraphs, implementing the GraphQL Federation contract. The Router can be built from source or run as a Docker container. Most users prefer using published Docker images for customizations. The Cosmo Router's goal is to minimize network requests. The article discusses three approaches to implementing the `@skip` and `@include` directives in the Router: Subgraph Directive Evaluation Approach, Smart but expensive Approach, and Zero-Cost Abstraction. The Zero-Cost Abstraction normalizes the query by removing unnecessary fields that are skipped or included using these directives, resulting in a significant reduction in latency and improved performance.