MySQL source plugin for Gatsby that allows pulling data from a MySQL database into Gatsby's GraphQL layer. Current stable version is 2.2.3. The plugin supports multiple queries, joins between tables (one-to-one and one-to-many), and remote image downloading for Gatsby image processing. It is specifically for Gatsby v2+ and requires gatsby-source-filesystem as a peer dependency. Compared to other database source plugins, it offers a straightforward configuration with SQL queries and automatic type generation.
npm install gatsby-source-mysqlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Configure the plugin in gatsby-config.js with MySQL connection details and SQL queries to create Gatsby nodes.
Ensure gatsby-source-filesystem is installed: npm install gatsby-source-filesystem
Use parameterized queries or stored procedures, but the plugin does not support them directly. Only use hardcoded or server-side validated queries.
Upgrade gatsby to v2.x or consider using a different plugin for newer Gatsby versions.
Ensure the options.queries[].name is set correctly and the plugin is properly configured in gatsby-config.js.
Run: npm install gatsby-source-filesystem
Verify MySQL host, port, and credentials. Ensure the MySQL server is accessible.