Skip to content

Latest commit

 

History

History
66 lines (45 loc) · 1.79 KB

README.md

File metadata and controls

66 lines (45 loc) · 1.79 KB

Relay Modern Example

Relay Modern is a new version of Relay designed from the ground up to be easier to use, more extensible and, most of all, able to improve performance on mobile devices. Relay Modern accomplishes this with static queries and ahead-of-time code generation.

This example relies on graph.cool for its GraphQL backend.

Deploy your own

Deploy the example using Vercel:

Deploy with Vercel

How to use

Using create-next-app

Execute create-next-app with npm or Yarn to bootstrap the example:

npx create-next-app --example with-relay-modern with-relay-modern-app
# or
yarn create next-app --example with-relay-modern with-relay-modern-app

Download manually

Download the example:

curl https://codeload.github.com/vercel/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-relay-modern
cd with-relay-modern

Install it:

npm install
# or
yarn

Download schema introspection data from configured Relay endpoint

npm run schema
# or
yarn schema

Run Relay ahead-of-time compilation (should be re-run after any edits to components that query data with Relay)

npm run relay
# or
yarn relay

Run the project

npm run dev
# or
yarn dev

Deploy it to the cloud with Vercel (Documentation).