Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

116
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda