Created
September 20, 2019 20:09
-
-
Save renanmav/c58bd6215866c978244dd80e28da1ad6 to your computer and use it in GitHub Desktop.
Setup RelayNetworkLogger with relay-runtime v6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Network } from 'relay-runtime' | |
import createRelayNetworkLogger from 'relay-runtime/lib/network/createRelayNetworkLogger' | |
import RelayNetworkLoggerTransaction from 'relay-runtime/lib/network/RelayNetworkLoggerTransaction' | |
import cacheHandler from './cacheHandler' | |
const RelayNetworkLogger = createRelayNetworkLogger(RelayNetworkLoggerTransaction) | |
const network = Network.create( | |
process.env.NODE_ENV === 'development' ? RelayNetworkLogger.wrapFetch(cacheHandler) : cacheHandler | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment