February 2024 Summaries
6 posts from Wundergraph
Filter
Month:
Year:
Post Summaries
Back to Blog
The Viewer Pattern is a design approach used in GraphQL APIs where the API is modeled around a "viewer" - the currently authenticated user making the request. This pattern simplifies access control and authentication by adding a `viewer` field to the root of the schema, allowing for unified authorization rules across child fields. The pattern also enables multi-tenancy support by introducing a `tenant` field, which can be used to fetch data specific to the user and shop they are currently logged into. In a federated GraphQL API, the Viewer Pattern is implemented by using the `@key` directive to mark fields as "Entity Keys" that require joining with other Subgraphs. This enables teams to build Subgraphs that work well together without requiring custom authentication middleware or spreading access control rules across all fields in their schema. The pattern simplifies the implementation of Subgraphs and makes it easier for teams to define an "entry point" to their Subgraph, allowing for standardized access control and authentication.
Feb 28, 2024
1,615 words in the original blog post.
PemPem, a mobile-based trading platform for smallholder farmers, was experiencing rapid growth and scaling issues with its previous solution. They transitioned to WunderGraph Cosmo's GraphQL Federation solution, which allowed them to serve multiple endpoints without restrictions with a single router, alleviating concerns about client permissions and scalability. The Cosmo Router provided end-to-end observability across various data sources, enabling the team to understand usage patterns and improve development time for endpoints. With Cosmo Studio, they gained detailed analytics dashboards and advanced request tracing, allowing them to identify bottlenecks and maintain productivity. The migration process was smooth, with setup completed within a day and full production integration in under 30 days. WunderGraph Support provided timely assistance during the transition, making it an enjoyable experience for both parties.
Feb 28, 2024
949 words in the original blog post.
Rate limiting is crucial for protecting federated GraphQL APIs from abuse and DDoS attacks. However, traditional rate limiting solutions don't work well with federated GraphQL APIs due to the complex nature of GraphQL queries. Implementing rate limiting at the Edge can lead to imprecise results, while implementing it within Microservices can create organizational challenges. Instead, Cosmo Router uses Redis to store rate limit state and implements a simple rate limiting strategy based on the number of Subgraph requests within a given time period. This approach is transparent to clients, fast and efficient, and protects APIs from abuse while allowing legitimate requests to pass.
Feb 13, 2024
2,627 words in the original blog post.
TravelPassGroup.com achieved PCI compliance with GraphQL and WunderGraph Cosmo by utilizing a self-hosted router, which allowed them to control their data and ensure scalability according to their requirements. This setup enabled them to contain sensitive data within their federated graph while selectively determining which graphs were available to different groups, such as app developers. By using namespaces and label matchers, they could expose certain graphs to customers without exposing sensitive data. The migration from Apollo to Cosmo was relatively quick, taking only a day, due to the resemblance between the two products and minimal disruption caused by a reduced learning curve. WunderGraph Cosmo provides a secure environment for PCI compliance while giving control over traffic, making it an ideal solution for companies like TravelPassGroup.com that require data sovereignty and regulatory requirements such as GDPR and HIPAA.
Feb 12, 2024
1,259 words in the original blog post.
Soundtrack your Brand, a company providing music streaming platforms for businesses, has switched from Apollo to Cosmo due to concerns about Apollo's non-open-source licensing and business model. Despite being an early adopter of GraphQL, the company valued its alignment with GraphQL principles and sought an alternative that better resonated with their views. After exploring options, they chose WunderGraph Cosmo, which provided superior query planning capabilities, improved performance, increased productivity, cost savings, autonomous team shipments to end customers, flexible deployment options, and a speed of innovation. The migration process was made easy through close collaboration between the Soundtrack team and WunderGraph's engineers, resulting in rapid response times and a strengthened partnership. Cosmo's open-source solution allowed Soundtrack your Brand to easily migrate away from Apollo GraphQL while enjoying benefits such as improved performance, flexible deployment options, cost savings, and much more.
Feb 05, 2024
1,276 words in the original blog post.
The text discusses the issue of exhaustive switch cases in API clients, which can prevent the client from being forward compatible. This problem highlights three hidden issues when designing APIs: breaking clients, preventing forward compatibility, and the potential for unexpected behavior due to incomplete handling of all possible cases. The solution is to avoid using exhaustive switch cases in API clients and instead use a default case that handles unknown cases without throwing an error. To prevent this issue, it's recommended to inform and educate API users about the problem, be more conservative when adding new enum values or interface implementations, introduce a new field with a new type instead of adding a new enum value or interface implementation, version the API, track API usage and clients to identify and communicate breaking changes, and use analytics to monitor schema usage.
Feb 01, 2024
1,240 words in the original blog post.