title: How to generate query string from a nested object
body: <p>I want to generate a query string for my advanced filter. My object looks as follows:</p>
  
  <pre><code>{
     searchValue: {
       firstName: "John",
       lastName: "Doe",
       postalCode: "3130",
       city: "New York"
     },
      page: 1
   }
  </code></pre>
  
  <p>I'm using the <a href="https://nodejs.org/api/querystring.html" rel="noreferrer">querystring</a> library to try and format my desired string.</p>
  
  <pre><code>export function updateAdvancedSearchQueryString&lt;T&gt;(props: RouteComponentProps, newValues: T) {
    props.history.push({
      pathname: props.location.pathname,
      search: queryString.stringify(newValues)
    });
  }
  </code></pre>
  
  <p>The output I want to achieve: </p>
  
  <p><code>/trainers?page=1&amp;searchValue=firstName=John&amp;lastName=Doe&amp;postalCode=3130&amp;city=New_York</code></p>
  
  <p>The output I'm currently getting with this:</p>
  
  <pre><code>/trainers?page=1&amp;searchValue=%5Bobject%20Object%5D
  </code></pre>
  
  <p>How can I generate my desired querystring from the nested object?</p>