Skip to content

Commit

Permalink
actualized readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ihorkatkov committed Feb 11, 2018
1 parent 5690a43 commit 184ac88
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
[![Build Status](https://semaphoreci.com/api/v1/ihorkatkov/apollo-absinthe-upload-link/branches/master/badge.svg)](https://semaphoreci.com/ihorkatkov/apollo-absinthe-upload-link)

# Apollo-Absinthe-Upload-Link

A network interface for Apollo that enables file-uploading to Absinthe back
ends.

## Difference between `apollo-absinthe-upload-client` and `apollo-absinthe-upload-link`
[`apollo-absinthe-upload-client`](https://github.com/labtwentyfive/apollo-absinthe-upload-client)
was developed for first version of Apollo Client and it can't be used with second
version. This package was rewritten specifically for second version which supports
new middleware and link ibterface

## Difference between `apollo-upload-client` and `apollo-absinthe-upload-client`

Both Apollo, through
[`apollo-upload-server`](https://github.com/jaydenseric/apollo-upload-server),
and Absinthe support file-uploads through GraphQL-mutations, unfortunately, they
differ in their protocol.

## Usage

Install via yarn or npm and then use `createLink` from the package
Expand All @@ -32,13 +21,27 @@ const client = new ApolloClient({
});
```

### Usage with React Native
### Custom headers

Not tested. Contributing is welcome.
Custom headers can be passed through options of the link.

### Optional dependencies
```js
import ApolloClient from "apollo-client";
import { createLink } from "apollo-absinthe-upload-link";

This library uses `fetch`, if you target older browsers you can polyfill both.
const headers = { authorization: 1234 }
const client = new ApolloClient({
link: createLink({
uri: "/graphql"
}),
headers,
});
```


### Usage with React Native

Not tested. Contributing is welcome.

## License

Expand Down

0 comments on commit 184ac88

Please sign in to comment.