October 2018 Summaries
4 posts from Hasura
Filter
Month:
Year:
Post Summaries
Back to Blog
Combining Next.js and Hasura's GraphQL Engine offers a streamlined approach to creating server-side rendered React websites, leveraging the strengths of both technologies to simplify the process. Next.js, developed by Zeit, facilitates fast server-side rendering by utilizing a distinct directory structure to manage page routes and incorporates server-side data fetching via the `getInitialProps` function. Meanwhile, Hasura provides an instant, secure GraphQL endpoint for Postgres databases, allowing developers to focus on integrating precise data requirements into the UI without the hassle of setting up a GraphQL server. The next-apollo library, contributed by Adam Soffer, enhances this setup by enabling server-side rendering of pages configured with GraphQL queries using the react-apollo's `getDataFromTree` function. A boilerplate and tutorial are available to help developers quickly implement this architecture and explore its capabilities.
Oct 29, 2018
401 words in the original blog post.
Hasura and Prisma are both tools that provide a GraphQL API over Postgres. However, they differ in their ideal placement within a tech stack and the value they add to projects. Hasura is designed for frontend applications, while Prisma is intended as a GraphQL ORM for GraphQL or REST servers. Prisma cannot be used directly by frontend apps, but Hasura can serve as a GraphQL API for microservices.
In terms of business logic, Prisma provides clients and bindings for nodejs/typescript/go to build custom business logic that communicates with the database. On the other hand, Hasura offers two ways to write business logic: either by creating a unified GraphQL endpoint or through webhooks triggered by changes in the database.
Hasura also provides access control and authorization features for securing data access, integrating with various authentication systems like JWT. It supports performance optimization through its high-performance architecture that compiles GraphQL queries into single SQL queries with access-control clauses. Additionally, Hasura has a low resource footprint compared to Prisma's requirement of the JVM.
Scaling and managing Postgres is seamless with Hasura, as it supports the entire Postgres type system and operators, custom SQL functions, and materialized views. In contrast, Prisma requires manual management of database migrations through GraphQL SDL, which may not be sufficient for complex applications.
Oct 11, 2018
977 words in the original blog post.
The text discusses the process of setting up Hasura GraphQL Engine (HGE) and Postgres in a CI/CD environment. It outlines steps to run Postgres as a Docker container, set up HGE with an environment variable for the database URL, and apply migrations or metadata using the Hasura CLI. Additionally, it mentions how to add sample test data through SQL files and connect applications to HGE for testing purposes. The text also provides examples of projects that use HGE in their tests.
Oct 09, 2018
582 words in the original blog post.
The text discusses a new open-source utility called firebase2graphql that helps developers migrate data from Firebase realtime database to Postgres while preserving the same application development experience, including realtime features. This tool uses Hasura GraphQL engine to expose GraphQL on postgres by dynamically creating the postgres schema and the GraphQL relationships from their CLI. The main problems solved are retaining the same query and data model structure as data is migrated from firebase into Postgres and automatically normalizing the denormalized firebase data model. The motivation behind this tool includes the advantages of using Firebase realtime database, GraphQL, and Postgres in combination.
Oct 08, 2018
1,121 words in the original blog post.