Skip to content
This repository has been archived by the owner on Feb 2, 2022. It is now read-only.
/ relay-star-wars Public archive

Playing with Star Wars GraphQL API with React Relay

Notifications You must be signed in to change notification settings

tapayne88/relay-star-wars

Repository files navigation

Star Wars API (SWAPI) via GraphQL with Relay

This project was bootstrapped with Create React App. Usual instructions apply.

Getting Started

Setup SWAPI

You need a local version of SWAPI running on port 8081 (the live version doesn't have CORS headers).

# Clone SWAPI
git clone git@github.com:graphql/swapi-graphql.git

# Install dependencies, this will also try run build-lambda and will likely fail - don't worry
yarn install

# Start server on port 8081
PORT=8081 yarn start

Setup App

# Install dependencies
yarn install

# Fetch GraphQL schema from deployed SWAPI
yarn relay:fetch_schema

# Generate relay query / fragment files
yarn relay

# Start create-react-app
yarn start