graphql-request
graphql-request copied to clipboard
ReactNative upload file
I see that the docs mention Upload in Browser and Node.
Does graphql-request support uploading files in react-native ?
i just figured it out, yes it supports it and it goes like this :
import { ReactNativeFile } from 'extract-files';
const mutation = gql`
mutation uploadFile($file: Upload) {
uploadFile(file: $file)
}
`;
graphQLClient.request(mutation, {
file: new ReactNativeFile({ uri, type, name }),
});
This does not seem to work for me
https://github.com/jasonkuhrt/graphql-request/issues/500
I see, we had to switch to apollo due to this :(