ryanlntn / apollo-absinthe-upload-link

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status

Apollo-Absinthe-Upload-Link

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

Usage

Install via yarn or npm and then use createLink from the package in the construction of your ApolloClient-instance.

import ApolloClient from "apollo-client";
import { createLink } from "apollo-absinthe-upload-link";

const client = new ApolloClient({
    link: createLink({
        uri: "/graphql"
    })
});

Custom headers

Custom headers can be passed through options of the link.

import ApolloClient from "apollo-client";
import { createLink } from "apollo-absinthe-upload-link";

const headers = { authorization: 1234 } 
const client = new ApolloClient({
    link: createLink({
        uri: "/graphql"
    }),
    headers,
});

Usage with React Native

Not tested. Contributing is welcome.

License

MIT (see LICENSE)

Acknowledgements

About

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


Languages

Language:JavaScript 100.0%