Home / Companies / Hasura / Blog / March 2024

March 2024 Summaries

2 posts from Hasura

Filter
Month: Year:
Post Summaries Back to Blog
This article discusses the benefits of a domain-driven approach to designing feature-rich, high-performance GraphQL APIs. It contrasts this method with the schema-first approach and demonstrates how compiling GraphQL queries to a domain model (database query or existing API) can result in superior APIs, better performance, and faster timelines. The article provides detailed examples of implementing a Top N relational query using both approaches and highlights the advantages of leveraging database capabilities for features like pagination, filtering, sorting, and aggregation. It also emphasizes the importance of optimizing queries for high performance by utilizing advanced PostgreSQL features such as lateral joins, window queries, union, and prepared statements. Overall, the domain-driven approach can significantly improve API quality, consistency, and productivity while reducing development time and potential bugs.
Mar 28, 2024 2,028 words in the original blog post.
In this article, the author discusses their experience building a GraphQL server using Netflix DGS in Java. They conclude that standing up a GraphQL server with Netflix DGS involves a heavy lift due to the need for cobbling together numerous frameworks, lots of boilerplate code, and ample context switching. The author also mentions that this is consistent with other schema-first, resolver-oriented approaches to GraphQL, which suffer from long development cycles, shallow APIs, and tight coupling to data models. The article then delves into the details of building a Netflix DGS GraphQL server, including getting Spring Boot, adding Netflix DGS, creating a GraphQL schema, implementing DataFetchers, defining Plain Old Java Objects (POJOs), accessing real data using Hibernate, and setting up fetching. The author also discusses the importance of writing test cases in tandem with implementation to iterate on the project rapidly and confidently until it builds and functions properly. The article concludes by questioning whether a full-featured GraphQL server can be built "in record time" using Netflix DGS, Spring Boot, an ORM, and other frameworks and libraries. The author suggests that there is a better way to build a full-featured GraphQL server: adopting a data-first compiler-oriented approach instead of the current conventional wisdom of schema-first resolver-oriented approach. They argue that this more sophisticated approach will be necessary as the volume, velocity, and variety of data continue to grow in enterprise settings.
Mar 01, 2024 3,461 words in the original blog post.