A network interface for Apollo that enables file-uploading to Absinthe back ends.
Both Apollo, through
apollo-upload-server
,
and Absinthe support file-uploads through GraphQL-mutations, unfortunately, they
differ in their protocol.
Install via yarn or npm and then use createNetworkInterface
from the package
in the construction of your ApolloClient
-instance.
import ApolloClient from 'apollo-client'
import { createNetworkInterface } from 'apollo-absinthe-upload-client'
const client = new ApolloClient({
networkInterface: createNetworkInterface({
uri: '/graphql'
})
})
This library uses fetch
and Object.entries
, if you target older browsers you
can polyfill both.
MIT (see LICENSE)
- @jaydenseric's apollo-upload-client