redux-boot-apollo-client

1.0.0 • Public • Published

Redux Boot module: Apollo Client.

Build Status

Redux Boot module to use the Apollo Client.

Install

npm install redux-boot-apollo-client --save

Usage

import boot from 'redux-boot'
import createApolloClientModule from 'redux-boot-apollo-client'
 
import React from 'react'
import { render } from 'react-dom'
import { ApolloProvider } from 'react-apollo'
 
// React container of the App.
import App from './containers/App'
 
const initialState = {}
 
// Create the module with no custom options
// for the Apollo client instance.
const apolloClientModule = createApolloClientModule()
 
const modules = [apolloClientModule]
 
const app = boot(initialState, modules)
 
app.then(({store, action}) => {
  
  // Render your App with the Apollo provider.
  render(
    <ApolloProvider store={store} client={store.apolloClient}>
      <App />
    </ApolloProvider>,
    document.getElementById('content')
  )
})
 

Package Sidebar

Install

npm i redux-boot-apollo-client

Weekly Downloads

0

Version

1.0.0

License

GPL-3.0

Last publish

Collaborators

  • choko-org