Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

178
Views
Cannot post files from HTML input to graphql api

i am trying to send multiple files into my api in reactjs project, but the issue is that i do not see my files in the request when i see my network tab.

here is query for api

export const ADD_CLAIM = gql`
  mutation addClaim(
    $details: String!
    $file: [Upload]
  ) {
    addClaim(
      input: {
        journeyId: $journeyId
        details: $details
        file: $file
        insuranceRiskAnalysis: $insuranceRiskAnalysis
      }
    )
  }
`;

Frontend code

upon consoling the filesl like

console.log(files)

, from <input type="file" multiple/>, I see

File { name: "Testing sprint 13 - IOB.docx", lastModified: 1642575799836, size: 3031710, … }


//then hitting the api like
  iobClaim({
            variables: {
              journeyId:"xyz",
              details: values.details,
              file: files,
              insuranceRiskAnalysis: true
            },
          });


const [iobClaim, { loading }] = useMutation(ADD_CLAIM, {
    onError: (err: any) => {
      apiErrorHandler(err);

    },
    onCompleted: (data: any) => {
   
    },
  });

but then network tab shows empty file as you can see in the ss below

here

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!