0.5.0 • Published 7 years ago

@blueeast/bluerain-plugin-persist-redux v0.5.0

Weekly downloads
1
License
MIT
Repository
-
Last release
7 years ago

Apollo GraphQL Client Plugin

A fully-featured, production ready caching GraphQL client for every server or UI framework.

Usage

Run the following command in the plugin directoy:

npm i --save @blueeast/bluerain-plugin-apollo

Then in your boot function, pass the plugin like this:

import BR from '@blueeast/bluerain-os';
import ApolloPlugin from '@blueeast/bluerain-plugin-apollo';

BR.boot({
	plugins: [ApolloPlugin]
})

Components

None.

Filters

This plugin provides complete flexibility to modify the apollo client. This is done by providing various filter hooks at different stages of store initialization.

plugin.apollo.config

This hook gives the ability to modify the plugin configurations.

Parameters:

NameTypeDescription
configObjectPlugin configurations

Returns:

NameTypeDescription
configObjectPlugin configurations

Example:

This example activates subscriptions in apollo client.

import BR from '@blueeast/bluerain-os';

BR.Filters.add(
	'plugin.apollo.config',
	function ActivateApolloSubscriptions(configs) {
		return Object.assign({}, configs, {
			subscriptions: true
		})
	}
);

plugin.apollo.networkInterface

This hook gives the ability to hook into Apollo's network interface. A usecase can be to apply middlewares to it.

Parameters:

NameTypeDescription
networkInterfaceObjectApollo's networkInterface object

Returns:

NameTypeDescription
networkInterfaceObjectApollo's networkInterface object

API

ApolloPlugin

Extends Plugin

Main Persist Redux Plugin class.

Properties