Building a Music Playlist App with Gatsby, Contentful and Hasura Remote Joins
In this tutorial, we will learn how to build a music playlist app with Gatsby, Contentful, and Hasura Remote Joins. The app uses a Postgres database for storing metadata about music tracks, albums, playlists, and users, which is queried using Hasura GraphQL. Audio source files are stored in Contentful, and user authentication is handled by Auth0. The schema of the music playlist app includes an album table with multiple tracks, a playlist table linked to a user via the user table, and track information stored in Postgres but managed through Contentful. To merge data from these multiple sources, we will use Hasura Remote Joins. To get started, deploy GraphQL Engine on Hasura Cloud and set up PostgreSQL via Heroku. Then, configure Auth0 for authentication. Next, create necessary content types in Contentful for Tracks and add the required fields. Add Contentful as a Remote Schema in Hasura Console using the appropriate endpoint and access token. Create a remote relationship from the playlist_track table to the tracksCollection type of Contentful, ensuring that only relevant audio track information is fetched. Finally, use role-based permissions to manage app data access and permissions. Insert sample data to see how the response structure looks like for the GraphQL query.
Company
Hasura
Date published
July 26, 2019
Author(s)
Praveen Durairaju
Word count
739
Hacker News points
None found.
Language
English