title: NestJS/graphql intercepting graphql response
body: <p>What's the best way to intercept a response before sending it back in nestjs/graphql?</p>
  <p>I'm trying to intercept a response of a query result, extracting some of the data into the context.extensions before sending it back.
  I've tried applying a middleware using graphql-middleware but it does not work.</p>
  <p>this is what i've tried doing</p>
  <pre><code>export const Pagination: MiddlewareFn = async ({ info }, next) =&gt; {
  // here i'm trying to extract the data
  };
  </code></pre>
  <p>and this is where i'm trying to put it (resolver.ts)</p>
  <pre><code>@UseMiddleware(Pagination)
    findAll(options: PaginationInput): Promise&lt;PaginatedReport&gt; {
      return applyPagination(this.reportRepository, options);
  }
  </code></pre>