title: fetching data in Next.js
body: <blockquote>
  <p>You should not fetch an API route from getStaticProps — instead, you
  can write the server-side code directly in getStaticProps.</p>
  </blockquote>
  <p>above sentence is from official docs of next.js and i find it confusing.<br>
  is it saying that i shouldn't do ajax request to my restful api? (i m using node express app as backend).<br> i m new to next.js, before i was using react node app with mongodb as database. i used moongose package for database related queries.<br> if i am not supposed to do ajax request then how am i supposed to work with data fetching related thing? can i use moongose in frontend directly?</p>
  <pre><code>//the way i want to do   
   getStaticProps(){
      //here i want to get data from database about posts
      //fetch('some end point of my restful api'){...}
      }
  //the way i think official docs is telling me to do
       getStaticProps(){
          //query from database
  
      
          }
  </code></pre>