text: /**
   * Implement Gatsby's Node APIs in this file.
   *
   * See: https://www.gatsbyjs.org/docs/node-apis/
   */
  
  // You can delete this file if you're not using it
  exports.createPages = async ({ actions: { createPage }, graphql }) => {
    createPage({
      path: "/no-data/",
      component: require.resolve("./src/templates/no-data.js"),
    })
    createPage({
      path: "/page-with-context/",
      component: require.resolve("./src/templates/with-context.js"),
      context: {
        title: "We Don’t Need No Stinkin’ GraphQL!",
        content: "<p>This is page content.</p><p>No GraphQL required!</p>",
      },
    })
    const results = await graphql(`
      {
        allProductsJson {
          edges {
            node {
              slug
            }
          }
        }
      }
    `)
  
    if (results.error) {
      console.error("graphql query ERROR")
      return 
    }
  
    results.data.allProductsJson.edges.forEach(edge => {
      const product = edge.node
  
      createPage({
        path: `/${product.slug}/`,
        component: require.resolve("./src/templates/product-graphql.js"),
        context: {
          slug: product.slug,
        },
      })
    })
  }
  