title: Passing Variables into GraphQL Query in Gatsby
body: <p>I want to limit the number of posts fetched on my index page. Currently, the number of pages is hard-coded into the GraphQL query.</p>
  <pre><code>query {
      allMarkdownRemark(limit: 5, sort: { fields: [frontmatter___date], order: DESC }) {
        totalCount
        edges {
          node {
            ...
          }
        }
      }
    }
  </code></pre>
  <p>I want to replace &quot;5&quot; with the value of a variable. String interpolation will not work with the <code>graphql</code> function, so I have to use another method.</p>
  <p>Is there a way to achieve this and pass variables into a GraphQL query in GatsbyJS?</p>