Skip to content
This repository has been archived by the owner on Apr 9, 2023. It is now read-only.

Demo project with React-Apollo v3.0 beta (hooks ftw!)

Notifications You must be signed in to change notification settings

emimuresan/react-apollo-hooks

Repository files navigation

React Apollo Demo Project

Demo project with React-Apollo v3.0 beta and AWS AppSync & Amplify used to create a serverless GraphQL backend.

This project was bootstrapped with Create React App.

How to Initialize a Backend

Prerequisite: Install and configure the Amplify CLI.

$ amplify configure
  1. Set up Amplify
$ amplify init
  1. Install Amplify libraries
$ npm install aws-amplify @aws-amplify/ui-react
  1. Setup the frontend (add code in src/index.js)
import Amplify from "aws-amplify";
import awsExports from "./aws-exports";
Amplify.configure(awsExports);
  1. Add a GraphQL API and automatically provision a database
$ amplify add api
  1. Deploying the API
$ amplify push
  1. Check Amplify’s status
$ amplify status
$ amplify console api

The fronted is now ready to be connected to the API using the API key.

More detailed steps can be found here.

Available Scripts

In the project directory, you can run:

yarn start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

yarn test

Launches the test runner in the interactive watch mode.

yarn build

Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

Docs

Apollo Client (React) v3.0: https://www.apollographql.com/docs/react/v3.0-beta

Releases

No releases published

Packages

No packages published