bluerain-apollo-plugin
A fully-featured, production ready caching GraphQL client for every server or UI framework. https://blueeast.gitbook.io/bluerain-plugin-apollo
|
|
|
---|---|---|
Screenshots
NA
Components
This plugin registers following components in the Component registry, so they can be reused later by other apps and plugins;
-
https://www.apollographql.com/docs/react/api/react-apollo.html#apollo-consumer
-
https://www.apollographql.com/docs/react/essentials/queries.html#basic
-
https://www.apollographql.com/docs/react/essentials/mutations.html
-
https://www.apollographql.com/docs/apollo-server/v2/features/subscriptions.html
This plugin provides complete flexibility to modify the apollo client. This is done by providing various filter hooks at different stages of store initialization.
This hook gives the ability to modify the main System App component that gets wrapped in Redux's Provider.
Name Type Description SystemApp React.Component The main system app component. Name Type Description SystemApp React.Component The main system app component. 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); }
This hook gives the ability to modify the plugin configurations.
Parameters:
Name Type Description config Object Plugin configurations Returns:
Name Type Description config Object Plugin 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 }) } );
This hook gives the ability to provide uri for websocket server
Parameters:
Name Type Description link Array uri for websocket server Returns:
Name Type Description link Array uri for websocket server Example:
'plugin.apollo.links': (links) => { return links; }
This Hook clears cache of the of Apollo store
This Hook Create apollo client when all plugins and apps are initialized
API
-
This is the default configuration set that is used at boot time.
- httpLinkOptions HttpLinks URI link of websocket server
-
clientOptions
ApolloClientOptions Apollo client params
Main Apollo Plugin class.
Returns Apollo client