Skip to main content

Relay Environment

This section of the docs is quite lacking. However, most of the information you need is available in the official Relay documentation.

Missing field handlers

Start by reading this section of the Relay docs.

API reference for missing field handlers is available here

You can teach Relay about relations in your schema in order to increase cache hits. In general, there should be no need to use this for most projects. But, occasionally there will be good reason to do so.

The section below details how missing field handlers work in RescriptRelay. Please start by reading the Relay documentation linked above to have a good understanding of how this works in Relay in general.

Creating missing field handlers

You create a missing field handler by using the appropriate make-method from the module RescriptRelay.MissingFieldHandler. These are:

  1. makeScalarMissingFieldHandler for creating a missing field handler for scalar values (like a name on a User).

  2. makeLinkedMissingFieldHandler for creating a missing field handler for a single linked record (like a Pet on the field favoritePet on a User).

  3. makePluralLinkedMissingFieldHandler for creating a missing field handler for lists of linked records (like a list of Pet on the field allPets on a User).

Examples

Coming soon.