The Example App.graphql.js screenshot

The Example App.graphql.js

Author Avatar Theme by Contentful
Updated: 18 Jan 2023
20 Stars

Example app for Contentful with GraphQL with React

Overview

This is a readme file for a project called “graphql-js example app” that teaches the basics of working with Contentful - a content infrastructure for digital teams. The app demonstrates how to consume content from Contentful’s APIs, model content, and edit content through the Contentful web app. It emphasizes decoupling content from its presentation to enable greater flexibility and faster shipping of software.

Features

  • Consume content from the Contentful Delivery and Preview APIs
  • Model content using Contentful’s web app
  • Edit content through the Contentful web app

Installation

To install and run the app, you need the following requirements:

  • Node 8
  • Git

Here are the steps for setting up the app:

  1. Clone the repository.
  2. Install the dependencies.
  3. For read-only access, start the express server using the command npm start. This will open the app at http://localhost:3000.
  4. To deploy the app to Heroku, follow the provided instructions.

Additionally, if you are using fragments over union types in this project, you need to set up an IntrospectionFragmentMatcher. This requires extracting the schema and storing it in a JSON file. The provided schema json can be re-exported if the schema changes.

Summary

This project is a simple example app that demonstrates how to work with Contentful. It provides a guide on how to consume, model, and edit content using Contentful’s APIs and web app. By decoupling content from its presentation, developers can achieve greater flexibility and ship software more quickly. The app also offers instructions for installation and deployment to Heroku, as well as additional setup steps for using fragments over union types.