An HTTP link for apollo that allows for simpler file uploads
npm install apollo-link-uploadThis package can be used to perform file uploads. It is compatible with Absinthe and GraphQL::Extras.
- Written in TypeScript.
- Simple server-side implementation.
- Support for FileList and multiple file uploads.
- Supports React Native.
``javascript
import ApolloClient from "apollo-client";
import { createUploadLink } from "apollo-link-upload";
const client = new ApolloClient({
link: createUploadLink({ uri: "/graphql" })
});
`
Values submitted in React Native will only be recognized as a file if it is an instance of ReactNativeFile.
`javascript
import { ReactNativeFile } from "apollo-link-upload";
const file = new ReactNativeFile({
uri: "something",
name: "a.jpg",
type: "image/jpeg"
});
`
- apollo-upload-client
- apollo-absinthe-upload-link`
To install dependencies:
$ yarn install
To run the test suite:
$ yarn test