Track image upload progress in graphql mutation

Track image upload progress in graphql mutation


0

I am running a graphql mutation to upload an image to the server. And operation is done successfully. My only question is that how do i track the progress of image upload on frontend? What percentage of the image size is uploaded? I want to show it in the progressbar in the frontend.
Below is my graphql mutation

const { mutate: addProfilePicture } = useAddProfilePictureMutation<Error>(
graphqlRequestClient(graphqlEndpoint),
{
  onSuccess: (
    _data: AddProfilePictureMutation,
    _variables: AddProfilePictureMutationVariables,
    _context: unknown
  ) => {
    console.log(_data)
  },
}

)

1 Answer
1


0

If you have an Angular front-end, you could use HTTP – Track and show request progress.



Leave a Reply

Your email address will not be published. Required fields are marked *