Hello World, for Relay Modern
I made this repo because I was excited by the f8 announcements and wanted to jump in and start hacking. Like many huge projects in the nodesphere, it takes longer to get started than it does to write the code. I want to help others get started.
tl;dr to run this project locally:
# Runs a GraphQL server at http://localhost:8080/graphql
# You can view and explore the GraphQL schema/REPL from the browser
make graphql-dev
# Runs an Express server and a Webpack Dev Server
# Go to http://localhost:3000 in your browser - this is the frontend of your app
make dev
Those commands will install everything you need (if you're using a Mac).
If you mess around with the code and want to add more queries or fragment containers, you need to refresh the static query data via:
yarn run relay
# open a new tab and run a watcher
yarn run relay -- --watch
Relay Modern is the next iteration of Relay from Facebook. Relay is a frontend framework for writing React apps that get their data from GraphQL. We are building the next version of the New York Times using Relay.
It can be a nightmare to learn all of the separate libraries that go into creating a Relay app. Before you can even start, you might have to spend hours learning Webpack, ES6, GraphQL, React, the list goes on forever.
This "Hello, World" app serves a few purposes:
Things that are missing:
Relay, even in its modern state, will evolve greatly in the short term. Libraries and frameworks will emerge just as we are settling into the new code. My advice is to take this time to familiarize yourself with the new APIs and try to build stuff them.