{"id":47727,"library":"gatsby-graphql-source-toolkit","title":"Gatsby GraphQL Source Toolkit","description":"A toolkit for building custom Gatsby source plugins that fetch data from remote GraphQL APIs. Current stable version: 2.0.4. This package is in maintenance mode pending a replacement. Unlike gatsby-source-graphql, it correctly sources nodes into Gatsby's data layer, enabling caching, incremental builds, and Gatsby Preview. Features include automatic pagination, concurrent data fetching, delta change tracking, and schema customization. Ships TypeScript definitions. Peer dependency on Gatsby v3/v4/v5.","status":"maintenance","version":"2.0.4","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","gatsby","graphql","typescript"],"install":[{"cmd":"npm install gatsby-graphql-source-toolkit","lang":"bash","label":"npm"},{"cmd":"yarn add gatsby-graphql-source-toolkit","lang":"bash","label":"yarn"},{"cmd":"pnpm add gatsby-graphql-source-toolkit","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; must be installed with a compatible version (^3.0.0 || ^4.0.0 || ^5.0.0)","package":"gatsby","optional":false}],"imports":[{"note":"Named export, not default. ESM module.","wrong":"import sourceAllNodes from 'gatsby-graphql-source-toolkit'","symbol":"sourceAllNodes","correct":"import { sourceAllNodes } from 'gatsby-graphql-source-toolkit'"},{"note":"CommonJS require is valid but using named import is preferred.","wrong":"const buildNodeDefinitions = require('gatsby-graphql-source-toolkit').buildNodeDefinitions","symbol":"buildNodeDefinitions","correct":"import { buildNodeDefinitions } from 'gatsby-graphql-source-toolkit'"},{"note":"Returns a query executor object; typically passed to other toolkit functions.","wrong":null,"symbol":"createDefaultQueryExecutor","correct":"import { createDefaultQueryExecutor } from 'gatsby-graphql-source-toolkit'"},{"note":"This is a custom function that fetches the remote schema, not the graphql-js loadSchema.","wrong":"import { loadSchema } from 'graphql'","symbol":"loadSchema","correct":"import { loadSchema } from 'gatsby-graphql-source-toolkit'"}],"quickstart":{"code":"const { sourceAllNodes, buildNodeDefinitions, createDefaultQueryExecutor, loadSchema, compileNodeQueries, createSchemaCustomization } = require('gatsby-graphql-source-toolkit');\n\nexports.sourceNodes = async (gatsbyApi) => {\n  const executor = createDefaultQueryExecutor('https://api.example.com/graphql');\n  const schema = await loadSchema(executor);\n  const nodeDefs = await buildNodeDefinitions([\n    { remoteTypeName: 'Post', queries: `\n      query LIST_POST { posts { id title } }\n      query GET_POST($id: ID!) { post(id: $id) { id title } }\n    ` }\n  ]);\n  const queries = compileNodeQueries({ schema, gatsbyApi, nodeDefs });\n  await sourceAllNodes({ gatsbyApi, schema, executor, queries });\n};\n\nexports.createSchemaCustomization = (gatsbyApi) => {\n  const nodeDefs = /* same as above */;\n  createSchemaCustomization({ gatsbyApi, nodeDefs });\n};","lang":"javascript","description":"Shows how to configure and use the toolkit in a Gatsby source plugin: set up executor, load schema, define node types, compile queries, and source nodes."},"warnings":[{"fix":"Monitor the Gatsby repository for the replacement package; for now it works but no new features will be added.","message":"This package is in maintenance mode and will be replaced by a 'swiss army knife' solution. New projects should consider alternatives.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"Upgrade Gatsby to v3, v4, or v5, or pin to an older version of the toolkit (v1.x).","message":"Gatsby v3/v4/v5 are peer dependencies. Version 2.0.0 dropped support for Gatsby v2.","severity":"breaking","affected_versions":">=2.0.0 <3.0.0"},{"fix":"Refer to the examples repository (https://github.com/vladar/gatsby-graphql-toolkit-examples) for usage patterns.","message":"The toolkit does not provide a ready-to-use source plugin. It is a library to build custom source plugins. Beginners may expect it to work out of the box.","severity":"gotcha","affected_versions":"all"},{"fix":"Implement a custom adapter; see the README section on Custom Pagination Adapter.","message":"Automatic pagination relies on the remote schema following a specific pattern (e.g., edges/node). Non-standard pagination may require a custom PaginationAdapter.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'2.0.4':23 'api':19 'automat':56 'build':8,50 'cach':48 'chang':62 'concurr':58 'correct':39 'current':20 'custom':9,66 'data':15,45,59 'definit':69 'delta':61 'depend':71 'enabl':47 'featur':54 'fetch':14,60 'gatsbi':1,10,35,43,52,73,76 'gatsby-source-graphql':34 'graphql':2,18,37,77 'includ':55 'increment':49 'javascript':75 'layer':46 'mainten':28 'mode':29 'node':41 'packag':25 'pagin':57 'peer':70 'pend':30 'plugin':12 'preview':53 'remot':17 'replac':32 'schema':65 'ship':67 'sourc':3,11,36,40 'stabl':21 'toolkit':4,6 'track':63 'typescript':68,78 'unlik':33 'v3/v4/v5':74 'version':22","created_at":"2026-06-07T16:53:00.121081+00:00","updated_at":"2026-06-07T16:53:00.121081+00:00","problems":[{"fix":"Ensure createDefaultQueryExecutor is called with a valid URL and the executor is passed correctly to loadSchema.","cause":"loadSchema was called before setting up the executor or the schema is unavailable.","error":"TypeError: Cannot read property 'typeMap' of undefined"},{"fix":"Pass compiledQueriesDir in the options object, or ensure the Gatsby project root is set correctly.","cause":"Missing configuration option when compiling queries without providing an explicit directory.","error":"Error: \"compiledQueriesDir\" is required"},{"fix":"Run npm install gatsby or ensure Gatsby is in your project's dependencies.","cause":"Incorrect import path for Gatsby's graphql module. The toolkit expects Gatsby to be installed as a peer dependency.","error":"Error: Cannot find module 'gatsby/graphql'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"gatsby-graphql-source-toolkit","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}