Skip to content
This repository has been archived by the owner on May 22, 2019. It is now read-only.

Commit

Permalink
Export format function token
Browse files Browse the repository at this point in the history
#68

Co-authored-by: Dmitry Manannikov <[email protected]>
  • Loading branch information
2 people authored and fusion-bot[bot] committed Feb 14, 2019
1 parent 37c375c commit 3f664e1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ This plugin connects GraphQL schema to your Fusion.js server, allowing you to ho
- [API](#api)
- [Registration API](#registration-api)
- [`ApolloServerEndpointToken`](#apolloserverendpointtoken)
- [`ApolloServerFormatFunctionToken`](#apolloserverformatfunctiontoken)

---

Expand Down Expand Up @@ -57,6 +58,14 @@ import {ApolloServerEndpointToken} from 'fusion-plugin-apollo-server';

This should be registered to a string representing the desired GraphQL endpoint. If using [fusion-apollo-universal-client](https://github.com/fusionjs/fusion-apollo-universal-client), this will likely be the same value as `ApolloClientEndpointToken.

##### ApolloServerFormatFunctionToken

```js
import {ApolloServerFormatFunctionToken} from 'fusion-plugin-apollo-server';
```

Register function to format errors from resolvers. Could be used for logging.

##### ApolloContextToken

This can be used to transform the koa context into an apollo context.
Expand Down
5 changes: 4 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import serverPlugin from './server';
import type {DepsType, PluginServiceType} from './types';
import type {FusionPlugin} from 'fusion-core';

export {ApolloServerEndpointToken} from './tokens';
export {
ApolloServerEndpointToken,
ApolloServerFormatFunctionToken,
} from './tokens';

const plugin = __NODE__ ? serverPlugin : null;
export default ((plugin: any): FusionPlugin<DepsType, PluginServiceType>);

0 comments on commit 3f664e1

Please sign in to comment.