Skip to content

rmosolgo/graphql_defer_example

Repository files navigation

GraphQL-Ruby Defer Example

This app demonstrates how to use @defer with Rails, GraphQL-Ruby, Apollo Client and React.

The app is a deck builder for Magic the Gathering:

  • Decks are persisted in the app's local database (::Deck and ::Slot)
  • Cards are fetched from Scryfall's REST API (::Scryfall::Card)

@defer is used to reduce time-to-first-byte: local data is returned immediately, but external calls are deferred.

rails-with-defer

Development

  • Clone the repo
  • bundle install
  • bundle exec db:create db:migrate
  • Install & compile the local apollo-client fork (https://github.com/rmosolgo/apollo-client/):
    • cd app/javascript/apollo-client
    • npm install
  • yarn install
  • bundle exec rails server

About

Demo of GraphQL-Ruby + Rails + `@defer` directive

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published