Skip to content

An React and Apollo client to support a Netflix like interface demonstration.

Notifications You must be signed in to change notification settings

lancegliser/netflix-react-apollo

Repository files navigation

Netflix React Example

Provides a working React App integrated with a GraphQL server via Apollo client.

Upstream v1.2.0

git remote add upstream [email protected]:lancegliser/react-apollo.git

Topics

Prerequisites

Ensure the API paired with this code base is up and listening on port 5000.

Framework

This project was bootstrapped with Create React App.

Available Scripts

In the project directory, you can run:

graphql-codegen

This UI works from a GraphQL client first approach. Update the ./codegen.yml file to point at your API. Then create local *.graphql files in your src directory to build the calls you want for your project. The types in it will cause typescript code to be generated by running the following command:

npm run graphql-codegen

The generated classes are created at:

src/generated/types.ts

You can import those types in your own components, providing you Apollo client strongly typed hooks.

npm 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.

npm test

Launches the test runner in the interactive watch mode.

npm run 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.

The build is minified and the filenames include the hashes.
Your app is ready to be deployed!