nextjs intercept server side requests #9328
Replies: 5 comments
-
I'm also interested in this, how to intercept server requests. |
Beta Was this translation helpful? Give feedback.
-
I was able to find some youtube links or articles suggesting different ways to be do this done by @bahmutov https://www.youtube.com/watch?v=33Hq41O0bvU These should be helpful. I was however wondering how, or what would be the best way to do this with Apollo Client and |
Beta Was this translation helpful? Give feedback.
-
@hect1c @amirjr1378 @osenvosem did you figure out a way to archive intercepting of getServerSideProps for cypress component testing? (I added this question to stackoverflow as well https://stackoverflow.com/questions/70787370/cypress-component-testing-intercept-getserversideprops-requests) |
Beta Was this translation helpful? Give feedback.
-
I don't think there is a way to stub the actual server side network requests BUT you can stub the client page request and alter the response. It should look something like this:
|
Beta Was this translation helpful? Give feedback.
-
I wrote a solution to this problem here: #28469 (comment) |
Beta Was this translation helpful? Give feedback.
-
hi guys.
i want to intercept my getServerSideProps requests and mock it with my own data.
i use axios for requests.
can anyone help me to findout how ?
Beta Was this translation helpful? Give feedback.
All reactions