Skip to content

Instantly share code, notes, and snippets.

@youknowriad
Created January 7, 2017 10:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save youknowriad/7678870bcb53520f1e6086c4bef82ec3 to your computer and use it in GitHub Desktop.
Save youknowriad/7678870bcb53520f1e6086c4bef82ec3 to your computer and use it in GitHub Desktop.
GraphQL Provider
import { render } from 'react-dom';
import { GraphProvider } from 'react-graphql-redux';
import App from './app';
// create your redux store
const store = // ...
// define your GraphQL schema and root (see above)
const { schema, root } = createGraph( store );
// render your app wrapped in the GraphProvider
render(
<GraphProvider store={ store } schema={ schema } root={ root }>
<App />
</GraphProvider>
, document.getElementById('root')
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment