Skip to content

robrichard/defer-relay-example

 
 

Repository files navigation

@defer and @stream + Relay Example App

This is an example showing a minimal app using Relay with the @defer and @stream directives.

Getting Started

pnpm install
pnpm run start

Packages Used

  • Client
  • Server
    • [graphql-js] - GraphQL Schema
  • Dev Setup

Translation layer

See fetchGraphQL.ts for an example translation layer that converts the latest incremental delivery GraphQL response format to the Facebook internal format that Relay understands.

This requires a small modification to relay-runtime to ignore errors thrown from missing fields in deferred responses. If a field is included in both a deferred and non-deffered fragment, Relay expects the server to return this field twice. The latest spec algorithm ensures the same field is not executed multiple times.

About

Example project using @defer and @stream with Grats and Relay

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 95.8%
  • CSS 2.6%
  • HTML 1.1%
  • Shell 0.5%