support for injection of relayContext in prepareData and shim to RelayEnvironment
aihornmac opened this issue · 1 comments
aihornmac commented
Since I have been following the latest progress of react-relay, knowing that RelayContext
is renamed to RelayEnvironment
while adding injectNetworkLayer
and injectTaskScheduler
methods, it would be so nice if prepareData
allows a relayContext
to be passed down, with which I can put authorization into headers for each request on server-side.
btw, this module is so inspiring, thank you so much for you work!
denvned commented
Since v0.6 of isomorphic-relay, you can create a new instance of a Relay network layer (with injected authentication headers/cookies) on each request and pass it as the second argument to IsomorphicRelay.prepareData
.