Relay is a powerful GraphQL client. At Artsy we use it in both our web app and mobile app.
Relay is also complex and difficult to learn - but it's totally worth it! This project contains exercises to help you learn Relay* by introducing concepts a little bit at a time.
- Clone this repo.
- Install dependencies:
yarn install
. - Confirm that everything installed: if the command
yarn relay
fails, something's not right. Reach out in Artsy's #dev-help Slack channel if you're an Artsy employee, or create an issue if you're not.
Each folder under src/exercises
has a README.md containing instructions. Read and follow them!
Any time you see a laptop emoji (💻), you're going to edit code or run a command.
Start with exercise 0 on the Relay compiler!
For support, there is a completed
folder inside each exercise. If you get stuck, check there to see the code in the completed state for the exercise.
- Exercise 0: Relay Compiler
- Exercise 1: QueryRenderer
- Exercise 2: Fragment Container
- Exercise 3: Testing Queries
- Exercise 99: What's Next
These exercises are for Relay Modern, version 10.
These exercises have been built in support of new engineers at Artsy; thus they are based on code that looks like ours. Relay recently released version 11, including hooks, but neither Artsy's web app nor mobile app are running it yet.
When our codebase is updated to use a newer version of Relay, we'll update these exercises as well.
There are Common Mistakes
listed at the bottom of many of the instructions, so be sure to check those out if you run into roadblocks. If you still are blocked, open an issue.