I’d like a better understanding of getDataFromTree’s error policy and when I can expect it to throw errors. I’m trying to run getDataFromTree server-side in a NextJS app in getServerSideProps, and I think it might be hiding errors it encounters. The documentation doesn’t do a great job of explaining when I can expect getDataFromTree to throw an error (if ever). I guess what I’m asking - how can I get a good idea of whether my useQuery calls are returning errors during
getDataFromTree? My default errorPolicy for my client is “All”.
Any help would be appreciated, thanks
It doesn’t. Internally, it just renders your React component - and that will never throw an error to the outside.
At the end of it running, you’ll have the data of all successful queries, and in the worst case (I assume), it will have to make the other queries in the browser again.
So, effectively what your saying is that there is no way of telling if my
useQuery hooks return errors during the execution of
You should be able to look at the
error property returned by
useQuery, and if its populated,
throw it yourself (if you want the throw behavior). See if that works for you!