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

74
Views
Sigo recibiendo un error sobre mi graphql/Apllo que no puede deconstruir una propiedad de cache.readQuery diciendo que es nulo

error que sale

Sigo recibiendo este error para mi propiedad me en mi sitio React. está haciendo referencia a esta línea de código

 const PostForm = () => { const [postText, setText] = useState(''); const [characterCount, setCharacterCount] = useState(0); const [addPost, { error }] = useMutation(ADD_POST, { update(cache, { data: { addPost } }) { try { // update post array's cache // could potentially not exist yet, so wrap in a try/catch const { posts } = cache.readQuery({ query: QUERY_POSTS }); cache.writeQuery({ query: QUERY_POSTS, data: { posts: [addPost, ...posts] }, }); } catch (e) { console.error(e); } // update me object's cache const { me } = cache.readQuery({ query: QUERY_ME }); cache.writeQuery({ query: QUERY_ME, data: { me: { ...me, posts: [...me.posts, addPost] } }, }); }, }); // update state based on form input changes const handleChange = (event) => { if (event.target.value.length <= 280) { setText(event.target.value); setCharacterCount(event.target.value.length); } }; // submit form const handleFormSubmit = async (event) => { event.preventDefault(); try { await addPost({ variables: { postText }, }); // clear form value setText(''); setCharacterCount(0); } catch (e) { console.error(e); } };

¿Alguien tiene alguna idea de dónde debería echar un vistazo para solucionar este problema? ¡Muchas gracias!

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!