Registry / devops / gatsby-source-graphql

gatsby-source-graphql

JSON →
library5.16.0jsnpmunverified

Gatsby plugin that stitches remote GraphQL APIs into Gatsby's GraphQL data layer via schema merging. Version 5.16.0 is current and stable; it requires Gatsby 5 and Node >=18. It works by wrapping the remote query type under an arbitrary field name, enabling queries like `{ swapi { allPeople { ... } } }`. Unlike dedicated source plugins (e.g., gatsby-source-wordpress), this plugin does NOT support Incremental Builds, CMS Preview, image optimization, or full GraphQL data layer features. It is best suited for simple proof-of-concepts or when no specialized source plugin exists. Release cadence follows Gatsby's major versions.

devops
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Plugin not imported; configured in gatsby-config.js resolve string.

import gatsbySourceGraphql from 'gatsby-source-graphql'

Must use 'resolve' key, not 'plugin'.

{ resolve: 'gatsby-source-graphql', options: {...} }

Must be exactly 'typeName'.

typeName: 'SWAPI'

Must be exactly 'fieldName'.

fieldName: 'swapi'

Configures the plugin with a simple GraphQL endpoint (SWAPI) and demonstrates querying it in Gatsby.

// gatsby-config.js module.exports = { plugins: [ { resolve: 'gatsby-source-graphql', options: { typeName: 'SWAPI', fieldName: 'swapi', url: 'https://swapi-graphql.netlify.app/.netlify/functions/index', }, }, ], }; // Use in Gatsby page query query MyQuery { swapi { allPeople { people { name height } } } }
Debug
Known footguns
breakingDoes not support Incremental Builds (Delta/Partial builds). Build times may be very long for large remote schemas.
breakingDoes not support CMS Preview / real-time previews for content changes.
deprecatedNo image optimization or image CDN integration; images from remote GraphQL API are not processed.
gotchaThe plugin does not support Apollo Client directive transforms (e.g., @client, @connection).
gotchaAuthentication headers must be passed synchronously or via async function; do not pass an object with a `headers` key that is not a valid header object or async function.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
8 hits · last 30 days
gptbot
3
ahrefsbot
1
Resources