title: How can we get HttpServletRequest(DefaultGlobalContext) for GraphQL from RequestContextHolder for GraphQL (using graphql-spqr-spring-boot-starter)?
body: <p>I'm using <code>graphql-spqr-spring-boot-starter</code> library to migrate the existing Rest API project to GraphQL. I have a below piece of code to fetch the current <code>HttpServletRequest</code> from <code>RequestContextHolder</code> for Rest API:</p>
  
  <pre><code> HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder
          .currentRequestAttributes()).getRequest();
  </code></pre>
  
  <p>However, this returns null for GraphQL. I believe that is correct because for GraphQL we have to use <code>DefaultGlobalContext&lt;ServletWebRequest&gt;</code> and not <code>HttpServletRequest</code>. But I'm not sure how can we do that. </p>
  
  <p>But, I tried below piece of code:</p>
  
  <pre><code>RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes();
  return (HttpServletRequest) requestAttributes.resolveReference(RequestAttributes.REFERENCE_REQUEST); 
  </code></pre>
  
  <p>But it didn't work - <code>requestAttributes</code> returns null. </p>
  
  <p>I'm very new to GraphQL, could anyone please help me know how can I get HttpServletRequest (DefaultGlobalContext) for GraphQL? This will be much appreciated.</p>