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

145
Views
Mute un resultado de "useResult" (Vue Apollo)

Estoy usando la API de composición. Tengo un componente que consulta el backend y devuelve una lista de eventos:

 const { result, loading, error } = useQuery(FindEvents, variables, { fetchPolicy: 'cache-and-network' }) let events = useResult(result, [], data => data.events)

Esto funciona bien, sin embargo, tengo un componente secundario con un formulario en el que el usuario puede editar los datos de un solo evento, que luego se muta al backend y emite una actualización a la lista de eventos. Sin embargo, mi función que maneja la actualización en la lista arroja un error que dice que no puede actualizar un valor calculado:

 onEventUpdate (mutableEvent) { try { const index = _.findIndex(events.value, ({id}) => id === mutableEvent.id) // lodash if (index < 0) { events.value.push(mutableEvent); } else { events.value[index] = mutableEvent; } } catch (err) { console.error(`Couldn't assign value: ${err}`) // TypeError: Cannot assign to read only property '12' of object '[object Array]' } }

¿Hay alguna forma de actualizar esta propiedad?

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!