Skip to content

Instantly share code, notes, and snippets.

@sibelius
Last active October 7, 2022 23:07
Show Gist options
  • Save sibelius/de355f708e7078b2dcd03e537944296c to your computer and use it in GitHub Desktop.
Save sibelius/de355f708e7078b2dcd03e537944296c to your computer and use it in GitHub Desktop.
Debug Relay Store on Chrome DevTools
const env = new Environment({
network,
store,
handlerProvider: RelayDefaultHandlerProvider,
log: isDev ? relayTransactionLogger : null,
});
if (isDev) {
window.relayEnvironment = env;
window.debugRelayStore = () =>
env
.getStore()
.getSource()
.toJSON();
}
@RichardLindhout
Copy link

For other people

you only need this part

if (isDev) {
  window.relayEnvironment = environment;
  window.debugRelayStore = () =>
    env
      .getStore()
      .getSource()
      .toJSON();
}

And open your chrome console logger and execute

console.log(window.debugRelayStore())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment