0

I have a component wrapped in createFragmentContainer(), which I think is how this component got 'relay' attached to it as a prop. Then somewhere in this component we have:

commitMutationAsync(this.props.relay.environment, {something, something});

Now I want to call commitMutationAsync somewhere else, is there a way to get this relay environment instance without wrapping HOC onto a component?

I don't know the change between relay modern and relay. Is Relay.Store a potential solution?

Hua
  • 123
  • 8

1 Answers1

0

import environment from 'src/environment' (or whatever the environment's path is)

and don't forget to export it from the file

BorisTB
  • 1,686
  • 1
  • 17
  • 26