Aditya Singh
Aditya Singh

Reputation: 678

Track upload progress in graphl mutation

I am uploading image to server from front-end by running the graphql mutation. What i wanr is that how should get response that what percentage of image size has uploaded to the server. For example if image size is 1MB, then how many bytes has been uploaded to server?

This is how my mutation looks like

const { mutate: AddCaptainScanLicense } = useAddCaptainLicenseScanMutation<Error>(
graphqlRequestClient(graphqlEndpoint),
{
  onSuccess: (
    _data: AddCaptainLicenseScanMutation,
    _variables: AddCaptainLicenseScanMutationVariables,
    _context: unknown
  ) => {
    queryClient.invalidateQueries(["GetCaptainLicenseScan"])
  },
})

Upvotes: 1

Views: 160

Answers (0)

Related Questions