Skip to content

Instantly share code, notes, and snippets.

@didierfranc
Created July 2, 2018 12:47
Show Gist options
  • Save didierfranc/efb25cdd14c0b010a5f2146eed0be46d to your computer and use it in GitHub Desktop.
Save didierfranc/efb25cdd14c0b010a5f2146eed0be46d to your computer and use it in GitHub Desktop.
Get data from Relay store
// relay initialization
import { Environment, Network, RecordSource, Store } from 'relay-runtime'
const network = Network.create(...)
export const store = new Store(source)
export default new Environment({ network, store })
// app
import { store as relayStore } from '../store'
const store = relayStore.getSource()
const data = store.get(uuid)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment