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:
makeScalarMissingFieldHandler
for creating a missing field handler for scalar values (like aname
on aUser
).makeLinkedMissingFieldHandler
for creating a missing field handler for a single linked record (like aPet
on the fieldfavoritePet
on aUser
).makePluralLinkedMissingFieldHandler
for creating a missing field handler for lists of linked records (like a list ofPet
on the fieldallPets
on aUser
).
Examples
Coming soon.