Airtable data missing from GraphQL explorer

Airtable Integration Not Appearing in GraphQL

I’m trying to connect my Airtable database to GraphQL but running into issues. I installed the necessary dependencies using yarn and configured my gatsby-config.js file properly. Here’s my current setup:

require("dotenv").config({
  path: `.env.${process.env.NODE_ENV}`,
})

module.exports = {
  plugins: [
    {
      resolve: `gatsby-source-airtable`,
      options: {
        apiKey: process.env.GATSBY_AIRTABLE_KEY,
        concurrency: 3,
        tables: [
          {
            baseId: process.env.GATSBY_AIRTABLE_DATABASE_ID,
            tableName: `Portfolio`,
            mapping: {photo: `fileNode`}
          }
        ]
      }
    }
  ]
}

I’ve tried clearing the Gatsby cache and restarting the development server with elevated permissions, but the allAirtable query still doesn’t appear in GraphiQL. The data source seems to be missing entirely from the GraphQL schema. Has anyone encountered this problem before? What could be preventing the Airtable plugin from registering properly with GraphQL?

Quick debugging steps that usually catch this:

First, log into Airtable and check your API key has read permissions for that base. I’ve seen keys work for some bases but not others.

Next, hardcode your actual values instead of env variables to rule out loading issues:

apiKey: "your_actual_key_here",
baseId: "your_actual_base_id",

Run gatsby develop and watch the terminal. Any red text or Airtable warnings? That’s your problem.

Check your base ID format too. Should start with “app” plus random characters. People grab the wrong ID from the URL all the time.

If that doesn’t work, remove the mapping line temporarily. File attachments cause schema issues if your Airtable field setup isn’t right.

I hit the same wall with gatsby-source-airtable last year. Turned out my environment variables weren’t loading at build time. Your dotenv config looks fine, but double-check your .env file’s in the root directory and variable names match exactly. Here’s what tripped me up - Airtable needs at least one record in your Portfolio table for Gatsby to figure out the schema. If your table’s empty, add a test record, run gatsby clean, then gatsby develop. Also check your terminal output during startup. Auth errors with Airtable’s API get buried in the logs but they’ll kill your schema creation.

Had this same prob a few months back. Make sure table name in Airtable is exact - it’s case sensitive! Plus, Gatsby needs a full restart to see Airtable changes. Kill the process, run gatsby clean && gatsby develop again. Base permissions gotta be set to read for API key.

Check your Airtable base sharing settings - this trips up tons of people. You need to share the base with whatever account created your API key, even if that’s you. Hit Share in the top right of your base and make sure the API account has access. I’ve also run into network timeouts while developing. Your concurrency’s at 3 which should work, but drop it to 1 temporarily and see what happens. Some corporate networks or VPNs hate rapid API calls. Also double-check your table has data and your field names are clean. Gatsby-source-airtable chokes on certain field names that Airtable allows but GraphQL can’t handle.