title: How do I get query string params in NextJS middleware
body: <p>I'm using NextJS middleware and can get the <code>nextUrl</code> object from the request, which includes things like pathname, but how do I get query string parameters from within the middleware? I can see it comes back as part of the string returned by href which I could then parse myself but I was wondering if it is returned in an object of it's own?</p>
  <p>e.g.</p>
  <pre><code>export const middleware = (request) =&gt; {
    const { nextUrl: { query } } = request;
    ...
  };
  </code></pre>
  <p>where <code>query</code> equals</p>
  <pre><code>{
    param1: 'foo',
    param2: 'bar',
    etc.
  }
  </code></pre>