Deferred Fields

Currently the @defer directive requires Apollo Client in alpha. Track the state of the PR here: https://github.com/apollographql/apollo-client/pull/3686

Deferring fields allows you to prioritize fetching data needed to render the most important content as fast as possible, and then loading the rest of the page in the background.

Lighthouse's DeferExtension adds support for the experimental @defer directive provided by Apollo which you can read more about here.

Setup

Add the service provider to your config/app.php

'providers' => [
    \Nuwave\Lighthouse\Defer\DeferServiceProvider::class,
],

defer_example (image from https://blog.apollographql.com/introducing-defer-in-apollo-server-f6797c4e9d6e)