Facing issues auto-syncing Airtable data with Gatsby GraphQL to Algolia using the plugin

Configured Gatsby with Airtable source and Algolia indexing using custom queries, but the Algolia index remains empty after builds. Here’s an alternative setup:

const queryData = `{
  allContentRecords {
    nodes {
      objectID: id
      urlPath
    }
  }
}`;

const newQueries = [
  {
    query: queryData,
    transformer: ({ data }) => data.allContentRecords.nodes,
    indexName: 'customIndex'
  }
];

module.exports = {
  plugins: [
    {
      resolve: 'gatsby-source-airtable-enhance',
      options: {
        apiKey: process.env.AIRTABLE_API,
        tables: [
          { baseId: process.env.BASE_ID, tableName: 'Records', view: 'Main View' }
        ]
      }
    },
    {
      resolve: 'gatsby-plugin-algolia-transform',
      options: {
        appId: process.env.ALGOLIA_APP,
        apiKey: process.env.ALGOLIA_KEY,
        indexName: 'customIndex',
        queries: newQueries,
        chunkSize: 500000
      }
    }
  ]
};

I had a similar experience where the data wouldn’t flow into Algolia. I eventually found that the issue stemmed from a mismatch in what was being outputted in the transformer function versus what Algolia expected in the index. I ensured that every node in my query returned the necessary fields and adjusted my query accordingly. Additionally, revisiting the documentation helped me catch some minor syntax issues in my Gatsby configuration. Double checking these aspects resolved the data sync problem in my setup.