File size: 679 Bytes
1e92f2d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
// @flow
import gql from 'graphql-tag';
import { graphql } from 'react-apollo';
import type { EntityTypes } from 'shared/types';
export type UploadImageType = {
data: {
uploadImage: string,
},
};
export type UploadImageInput = {
image: Object,
type: EntityTypes,
id?: string,
};
export const uploadImageMutation = gql`
mutation uploadImage($input: UploadImageInput!) {
uploadImage(input: $input)
}
`;
const uploadImageOptions = {
props: ({ mutate }) => ({
uploadImage: (input: UploadImageInput) =>
mutate({
variables: {
input,
},
}),
}),
};
export default graphql(uploadImageMutation, uploadImageOptions);
|