text: const fetch = require(`node-fetch`)
  const { createHttpLink } = require(`apollo-link-http`)
  require('dotenv').config()
  
  module.exports = {
    siteMetadata: {
      title: 'TIL - Today I Learned',
    },
    plugins: [
      'gatsby-plugin-react-helmet',
      {
        resolve: `gatsby-plugin-manifest`,
        options: {
          name: 'gatsby-starter-default',
          short_name: 'starter',
          start_url: '/',
          background_color: '#663399',
          theme_color: '#663399',
          display: 'minimal-ui',
          icon: 'src/images/gatsby-icon.png', // This path is relative to the root of the site.
        },
      },
      'gatsby-plugin-offline',
      {
        resolve: 'gatsby-source-graphql',
        options: {
          typeName: 'HASURA',
          fieldName: 'hasura',
          createLink: () =>
            createHttpLink({
              uri: `${ process.env.HASURA_GRAPHQL_URL }`,
              headers: {},
              fetch,
            }),
          refetchInterval: 10, // Refresh every 60 seconds for new data
        },
      },
    ],
  }
  