"gatsby-source-graphql" threw an error while running the createSchemaCustomization lifecycle

Deploys of our Gatsby website suddenly started to fail (i.e. there weren’t any changes that could break it). The first failure happened on 2023-06-13T11:47:40.733Z.
The error message from the deploy log:

Full deploy log is here.

The issue is not reproducible locally, even when I tried removing all node modules and reinstalling them again. Also yarn.lock is in the repo so versions of dependencies should be exactly the same.
I tried cleaning cache and triggering deploy a few times but it didn’t help.

Build image: Ubuntu Focal 20.04 (default)
Node.js version: 16 (the same locally and on Netlify, from .nvmrc)

Hi, welcome to the community! Thanks for reaching out. I see your most recent build was successful for this site. Are you still experiencing this issue?

We managed to fix the issue. Sorry, it wasn’t directly related to Netlify. The problem was due to GraphQL introspection query failing on the backend, but locally Gatsby caches GraphQL data into the .cache directory that’s why I couldn’t reproduce it first.

Thank you for sharing the solution! Super glad to hear you fixed this.