Help for Lift-off part 2 Odyssey course

Awesome to see you moving along in your GraphQL Odyssey :rocket:!
If you’re stuck on Lift-off part 2 course, you’re on the right topic to get assistance :raised_hands:

3 Likes

Thanks, @Raph , you created an amazing guide, But I’m getting stuck in “Errors When queries go sideways”. I test case validation_Error, and response only gives back error, not includes data: null. So when I add query errorPolicy:‘all’, it does not work.
Can you help me?

Hello @qtruongbk. Thanks for learning with us.
Could you paste here both the query you wrote and the error you receive?
This will help us understand what might be wrong. (I’ve tested this code challenge this morning everything seems to be working ok.)
There shouldn’t be a need to change the errorPolicy option, are you using it in the useQuery Hook? This exercise is designed to be ran in Studio Explorer. (though you can do the test client side, but you’d need to go and grab the error from the devtools network tab, so less straightforward)

hwillson helped me.(Error Policy in Apollo Client React seems doesn't work).
Though, thank you!

1 Like

I followed the instructions but for me there isn’t any caching when running the query from Studio, the first query takes 360ms and all queries after that about the same time. Is there some changes after this tutorial was made or am I just completely lost?

1 Like

I noticed the same thing and I’m wondering if I missed something too. But even the final repo only mention the cache on client side at one single place, so no idea why we would get that difference for the exact same amount of data.

An answer could be great since it’s one of the benefits that are put forward.

Thanks for reaching out @CaroRoyDev, @azurinspire sorry we missed your question :sweat:

We had an issue in the cache setting logic of our rest API (only part of the queried data was cached). Now it should be back to normal. Testing right now:

  • with RESTDataSource I get around 900ms on the first call then 20ms on the subsequent ones
  • with fetch method I have consistent 750ms an all calls (no caching occurs)

Regarding your point here @CaroRoyDev could you give me more info, I’m not clear on what you mean

But even the final repo only mention the cache on client side at one single place

This lift-off introduction series only briefly touches on caching that is a deep topic. we plan on covering it in much more depth in a follow up more advanced series.

Hope this helps, and happy to continue the discussion further.
Best,
Raph

2 Likes

Thanks for your quick answer !
Yesterday, I followed the part 2 and each request was around 400 ms while requesting with author (and for all subsequent calls). So I was wondering if something was missing on my side since to enable cache we had only 1 line to had to the Apollo Client (too magical for me !)

I just retried this morning and got 55 ms response on subsequent calls with author. Everything is good now :slight_smile:

Thanks again for your responsiveness .

Great course by the way, it really stands out (We need more content with cats !)

Have a nice day,
Caroline

2 Likes