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

114
Views
Graphql multiple mutations

I have 3 mutations in a query. 6 input parameters. If (profile_status === true), then send the mutation. And so for each mutation. How to do it?

mutation updateProfile(
   $input: UpdateProfileMutationInput!
   $input2: UpdateUserEmailMutationInput!
   $input3: UpdateUserPasswordMutationInput!

   $profile_status: Boolean!
   $email_status: Boolean!
   $password_status: Boolean!
) {
   @include(if: $profile_status) updateProfile(input: $input) {
     ...CoreUser
   }

   @include(if: $email_status) updateEmail(input: $input2) {
     ...CoreUpdateUserEmail
   }

   @include(if: $password_status) updatePassword(input: $input3) {
     ...CoreUpdateUserPassword
   }
}

I use @apollo/client. Include only works for fields. Is there a similar one for mutation?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

From the specification:

The @skip directive may be provided for fields, fragment spreads, and inline fragments...

Implementation:

directive @skip(if: Boolean!) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT

As you can see, it doesn't have MUTATION location - it's not implemented for mutations. If you are the developer of the server, you can always create your own schema directive (guide for Apollo Server).

about 4 years ago · Juan Pablo Isaza Report
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!