Download spectrum/shared/graphql/mutations/uploadImage.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 679 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/shared/graphql/mutations/uploadImage.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/spectrum/shared/graphql/mutations/uploadImage.js
-
curl -L -o uploadImage.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/shared/graphql/mutations/uploadImage.js
679 Bytes
| // @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); | |