title: Pass data into createPages API from gatsby-node.js
body: <p>I want to pass data in the form of variables into my react components when using gatsbyjs </p>
  
  <p>I can generate pages at a different URL's but I want each one to have access to data outside of the GraphQL query. I am aware that context passed to GraphQL but I don't want to do this. </p>
  
  <p>For example using this I can create a page called localhost/my-page using a react component. However inside the component I fetch data from another server using AJAX and I need to pass a search query to my props inside the create page. </p>
  
  <p>How do I do this please? </p>
  
  <pre><code>const path = require('path');
  
  exports.createPages = ({ boundActionCreators }) =&gt; {
  const { createPage } = boundActionCreators
  
  const component = path.resolve('src/pages/demo-photos.js')
  
  const pages = [ 'one' ].map(name =&gt; ({
    id: `page-${name}`,
    path: `/${name}`,
    component,
    layout: `index`,
    context: {
        searchtag: `${name}`, // I WANT THIS AVAILABLE INSIDE MY REACT COMPONENT
    }
  }))
  
  pages.map(p =&gt; createPage(p))
  }
  </code></pre>