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

Combining Contentful GraphQL and Postgres via Hasura

Blog post from Contentful

Post Details
Company
Date Published
Author
Shy Ruparel
Word Count
878
Language
English
Hacker News Points
-
Summary

GraphQL enables schema stitching by creating a single schema from multiple underlying APIs, allowing developers to merge different databases such as Contentful and Postgres into a unified GraphQL API. This is achieved through remote schema relationships in Hasura, which establishes connections between the two databases. By setting up a remote schema relationship, developers can create a single query that retrieves user data from Hasura and content from Contentful, eliminating the need for separate queries to each database. The process involves creating a new table on Hasura, establishing a connection with Contentful through an API key and authorization header, mapping fields between the two databases, and defining a mutation to set favorite recipes. With this setup, developers can build a unified backend API using GraphQL, which can be further expanded upon for a full application.