title: Escaping word character selector in Gatsby GraphQL regex filter
body: <p>I am currently using Gatsby to build a documentation site for a component library that I have developed. I have installed the Transformer-Remark plugin which creates javascript objects for each markdown file within my site's structure.</p>
  
  <p>As the site is for documentation, I have a Component detail page which outlines how a component can be used by a consumer and the majority of the content of this page is derived from the README.MD of the corresponding package on NPM.</p>
  
  <p>On the left hand side of this page is a dynamic menu which lists the components I have created. The menu makes use of a GraphQL query within a custom Gatsby template to split the components into 3 categories based on a RegEx filter of their fileAbsolutePath like so:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>export const pageQuery = graphql`
    query($path: String!) {
      pageData: 
        markdownRemark(fields: { slug: { eq: $path } }) {
          html
          fields {
            slug
            title
          }
          fileAbsolutePath
        }
  
  
      atoms:
        allMarkdownRemark(sort: {order: ASC, fields: [fields___title]}, limit: 1000, filter: {fileAbsolutePath: {regex: "/dl-atoms-(\w+)/README/"}}) {
          edges {
            node {
              fields {
                slug
                title
              }
            }
          }
        }
  
      molecules:
        allMarkdownRemark(sort: {order: ASC, fields: [fields___title]}, limit: 1000, filter: {fileAbsolutePath: {regex: "/dl-molecules-(\w+)/README/"}}) {
          edges {
            node {
              fields {
                slug
                title
              }
            }
          }
        }
      organisms:
        allMarkdownRemark(sort: {order: ASC, fields: [fields___title]}, limit: 1000, filter: {fileAbsolutePath: {regex: "/dl-organisms-(\w+)/README/"}}) {
          edges {
            node {
              fields {
                slug
                title
              }
            }
          }
        }
    }
  `;</code></pre>
  </div>
  </div>
  </p>
  
  <p>However when I try to run Gatsby Develop I get the following error:</p>
  
  <p><strong>Syntax Error: Invalid character escape sequence: \w.</strong></p>
  
  <p>I have tried adding a second backslash before the string in question to escape it but this doesn't work.</p>
  
  <p>Is there a special way of escaping certain characters in RegEx filters in GraphQL?</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>I should add that the same RegEx works fine on this RegEx testing site:
  <a href="https://regexr.com/436ep" rel="nofollow noreferrer">https://regexr.com/436ep</a></p>