{"id":15653748,"url":"https://github.com/sibelius/relay-workshop-old","last_synced_at":"2025-04-30T21:48:26.599Z","repository":{"id":48941273,"uuid":"368259064","full_name":"sibelius/relay-workshop-old","owner":"sibelius","description":"Material for my Relay Workshop","archived":false,"fork":false,"pushed_at":"2021-07-29T01:06:53.000Z","size":8,"stargazers_count":29,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-24T11:40:08.356Z","etag":null,"topics":["graphql","react","relay"],"latest_commit_sha":null,"homepage":"https://react-europe-relay-workshop.vercel.app/","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sibelius.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"patreon":"sibelius"}},"created_at":"2021-05-17T16:52:09.000Z","updated_at":"2025-02-23T07:41:36.000Z","dependencies_parsed_at":"2022-09-24T00:24:38.537Z","dependency_job_id":null,"html_url":"https://github.com/sibelius/relay-workshop-old","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sibelius%2Frelay-workshop-old","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sibelius%2Frelay-workshop-old/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sibelius%2Frelay-workshop-old/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sibelius%2Frelay-workshop-old/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sibelius","download_url":"https://codeload.github.com/sibelius/relay-workshop-old/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251789306,"owners_count":21644081,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["graphql","react","relay"],"created_at":"2024-10-03T12:46:53.779Z","updated_at":"2025-04-30T21:48:26.529Z","avatar_url":"https://github.com/sibelius.png","language":null,"funding_links":["https://patreon.com/sibelius","https://www.patreon.com/sibelius"],"categories":[],"sub_categories":[],"readme":"# Relay Workshop\n\nYou are going to learn Relay and build a mini social network at the end of this workshop\n\n## Access to the code\nYou can get access to the code sponsoring me at Patreon (https://www.patreon.com/sibelius) or using Bitcoin\n\n## Discussions\n\nIf you have any question about GraphQL/Relay you can discuss in Discusssion tab of this repo https://github.com/sibelius/relay-workshop/discussions\nI will provide my insights based on years working with GraphQL/Relay in production\n\n## Remote Workshop\n\nIf you are interested in this workshop as a remote workshop (live), send an email to sibeliusseraphini@gmail.com\nI can run this workshop in English/Portuguese (I'm still learning Spanish)\n\n## Feedback Form\n\nhttps://forms.gle/uxkoyyeuUSjADC3s7\n\n## Welcome 👋\n\nEach lesson including the exercise description can be found in each of the directories of /workshop.\n\nI will explain everything during the intro.\n\n## Code\n\nMost of it is written in TypeScript (not particularily well typed). Feel free to use plain JavaScript if you prefer that.\n\n## Structure\n\nThe workshop is a \"huge\" monorepo with many packages, let's see what's inside:\n\npackages - contains packages and code that make workshop exercises possible\n\n- babel - shared babel config\n- babelweb - shared babel config for web with react fast refresh\n- graphql - graphql utilities to make building graphql servers with graphql-js faster\n- relay - relay utilities\n- route - custom routing solution until react-router supports render as you fetch\n- server - graphql server used on demo and workshop exercises\n- test - test utilities to make tests easy\n- ui - minit design system to be used on demo and workshop exercises\n- web - demo app - mini social network\n- webpack - shared webpack config for the demo and workshop exercises\n\nworkshop - a set of practice exercises to really learn Relay\n\n- 01-fetchGraphql - fetch GraphQL data using pure React\n- 02-useLazyLoadQuery - fetch GraphQL data using Relay useLazyLoadQuery hook\n- 03-useFragment - refactor code to colocate data using useFrament hook\n- 04-usePagination - learn to paginate back and forward using usePagination hook\n- 05-useMutation - learn to do mutation using useMutation hook\n- 06-mutationUpdater - learn to update Relay store with mutation output data\n- 07-useRefetchableFragment - use useRefetchableFragment to do some refetch queries and update data\n- 08-useSubscription - learn how to useSubscription to make you app realtime\n- 09-usePreloadQuery - learn the render as you fetch pattern using preloadQuery and usePreloadQuery\n- 10-testUsePreloadQuery - learn how to test your Relay components using @testing-library\n- 11-testUseFragment - learn how to test a single component with useFragment\n- 12-testUseMutation - learn how to test mutations calls\n\nsolutions - the same folder of workshop but with my solutions\n\nslides - some slides to help in workshop\n\n- concepts - GraphQL and Relay Concepts\n\n## Requirements\n\n- yarn - we need to use yarn, as npm does not support workspaces yet\n- node lts - we recommend using node LTS version, and nvm to manage your node version\n- mongo - you can\n\n## Mongo\n\n### How to install mongo\n\n```sh\nbrew tap mongodb/brew\nbrew install mongodb-community\nbrew services start mongodb-community\n```\n\n### How to run mongo in docker\n\n```sh\ndocker run -d -p PORT:27017 --name CONTAINER_NAME -d mongo:latest - run mongo:latest image in detached mode\n```\n\ndocker tips\n\n```\ndocker ps: list all running containers\ndocker ps -a: list all containers (including the exited ones)\ndocker stop CONTAINER_NAME: stop the container\ndocker start CONTAINER_NAME: start the container\ndocker rm CONTAINER_NAME: delete the container to free disk space\ndocker image ls: list all downloaded images\ndocker rmi IMAGE_NAME:TAG: remove image from your computer to free disk space\n```\n\n### Use React Workshop mongo URI\n\n```sh\nmongodb+srv://sibelius:eYZlo2POmcyuUuRR@reacteurope-los0c.mongodb.net/test\n```\n\n## Server\n\n### Run\n\nServer runs at http://localhost:7500/graphql\n\n```sh\nyarn server\n```\n\n### How to update GraphQL schema SDL (schema.graphql)\n\n```sh\nyarn update-schema\n```\n\n### How to create a seed of posts\n\n```sh\nyarn seed\n```\n\n## How to update Relay artifacts\n\n```\nyarn relay\n```\n\n## How to get an Authorization Token\n\nUseful for exercises that user should be logged in\n\n```\nyarn get-token\n```\n\n## Setup .env\n\nWeb and workshops consumes a local .env, you just need to copy the .env.example to .env inside each package\n\n```sh\ncp .env.example .env\n```\n\n## Web\n\n```\nyarn web\n```\n\n## Run both `web` and `server` packages\n\n```bash\nyarn start\n```\n\n## How to run Workshop exercises\n\n- go inside the workshop/\u003cexercise\u003e/\n- run yarn start\n\nExample for 01-fetchGraphQL\n\n```bash\ncd ./workshop/01-fetchGraphQL\nyarn start\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsibelius%2Frelay-workshop-old","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsibelius%2Frelay-workshop-old","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsibelius%2Frelay-workshop-old/lists"}