title: Multiple graphql queries in Gatsby component
body: <p>I need to run multiple graphQL queries within a component and within the <code>gatsby-node.js</code> file. (Because Prismic is limited to 20 entries per answer...) </p>
  
  <p>I tried the following, just to see if I could create the graphql loop in the default function: </p>
  
  <pre><code>export default () =&gt; {
    async function allPosts() {
      let data
  
      await graphql(`
        query allDitherImages {
          prismic {
            allProjects(sortBy: meta_firstPublicationDate_DESC) {
              totalCount
              pageInfo {
                startCursor
                endCursor
                hasNextPage
                hasPreviousPage
              }
              edges {
                node {
                  cover_image
                  cover_imageSharp {
                    name
                  }
                }
              }
            }
          }
        }
      `).then(initialRes =&gt; {
        data = initialRes
      })
  
      return data
    }
  
    allPosts().then(result =&gt; {
      console.log(result)
    })
    return null
  }
  </code></pre>
  
  <p>But then Gatsby tells me that <code>Gatsby related 'graphql' calls are supposed to only be evaluated at compile time, and then compiled away. Unfortunately, something went wrong and the query was left in the compiled code.</code></p>
  
  <p>How can I run multiple graphql queries? </p>
  
  <p>Thank you in advance :) 
  Michael</p>