Home / Companies / Hasura / Blog / Post Details
Content Deep Dive

Create Next.js sites using GraphQL on Postgres

Blog post from Hasura

Post Details
Company
Date Published
Author
Karthik Venkateswaran
Word Count
401
Language
English
Hacker News Points
-
Summary

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.