forked from absinthe-graphql/absinthe-socket
-
Notifications
You must be signed in to change notification settings - Fork 0
/
readmeTemplate.ejs
54 lines (38 loc) · 1.27 KB
/
readmeTemplate.ejs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# <%= name %>
> <%= description %>
<!-- START doctoc -->
<!-- END doctoc -->
## Installation
### Using [npm](https://docs.npmjs.com/cli/npm)
```
$ npm install --save <%= name %>
```
### Using [yarn](https://yarnpkg.com)
```
$ yarn add <%= name %>
```
## Examples
- **relay-environment.js**
```javascript
// @flow
import {createFetcher, createSubscriber} from "@absinthe-phoenix-socket-relay";
import {Environment, Network} from "relay-runtime";
import absintheSocket from "./absintheSocket";
export default new Environment({
network: Network.create(
createFetcher(absintheSocket),
createSubscriber(absintheSocket)
),
store: new Store(new RecordSource())
});
```
## API
## References
- [Absinthe Socket](https://github.com/absinthe-graphql/absinthe-socket/tree/master/packages/socket)
- **Relay**
- [Environment](https://facebook.github.io/relay/docs/relay-environment.html)
- [NetworkLayer](https://facebook.github.io/relay/docs/network-layer.html)
- [FetchFunction](https://github.com/facebook/relay/blob/master/packages/relay-runtime/network/RelayNetworkTypes.js#L79)
- [SubscribeFunction](https://github.com/facebook/relay/blob/master/packages/relay-runtime/network/RelayNetworkTypes.js#L93)
## License
[<%= license %>](LICENSE.txt) :copyright: Jumpn Limited.