0.8.5 • Published 6 years ago

@blueeast/bluerain-plugin-apollo v0.8.5

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

bluerain-apollo-plugin

A fully-featured, production ready caching GraphQL client for every server or UI framework. https://blueeast.gitbook.io/bluerain-plugin-apollo

🌏 Web🖥 Electron📱 React Native
✔️✔️✔️

Screenshots

NA

Components

This plugin registers following components in the Component registry, so they can be reused later by other apps and plugins;

Hooks

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

bluerain.system.app

This hook gives the ability to modify the main System App component that gets wrapped in Redux's Provider.

Parameters:

NameTypeDescription
SystemAppReact.ComponentThe main system app component.

Returns:

NameTypeDescription
SystemAppReact.ComponentThe main system app component.

Example:

This example wraps the System App with a Apollo provider by using a replaceReduxProvider higher order component (HOC).

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

'bluerain.system.app': App => {
			return withApolloProvider(App, client);
		}

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.links

This hook gives the ability to provide uri for websocket server

Parameters:

NameTypeDescription
linkArrayuri for websocket server

Returns:

NameTypeDescription
linkArrayuri for websocket server

Example:


'plugin.apollo.links': (links) => {
			return links;
		}

plugin.apollo.cache:

This Hook clears cache of the of Apollo store

plugin.system.initialized:

This Hook Create apollo client when all plugins and apps are initialized

API

  • ApolloPluginConfigs

    This is the default configuration set that is used at boot time.

    Properties

    • httpLinkOptions HttpLinks URI link of websocket server
    • clientOptions ApolloClientOptions Apollo client params

    ApolloPlugin

    Extends Plugin

    Main Apollo Plugin class.

    Plugin Properties

    getClient

    Returns Apollo client

0.8.5

6 years ago

0.8.4

6 years ago

0.8.3

6 years ago

0.8.2

6 years ago

0.8.1

6 years ago

0.8.0

6 years ago

0.7.0

6 years ago

0.6.0

6 years ago

0.5.1

6 years ago

0.5.0

7 years ago

0.4.9

7 years ago

0.4.8

7 years ago

0.4.4

7 years ago

0.4.2

7 years ago

0.4.1

7 years ago

0.4.0

7 years ago

0.3.0

7 years ago

0.1.0

7 years ago