{"id":25616,"library":"gatsby-source-notion-database","title":"gatsby-source-notion-database","description":"A Gatsby source plugin that loads data from Notion databases into Gatsby's GraphQL layer. Version 0.6.9 is the latest stable release; the project has low release cadence (last update in 2021). It supports multiple database sources, optional caching (static vs dynamic), and automatically resolves relation properties. Compared to alternatives like gatsby-source-notion, this plugin offers a simpler configuration and direct table URL input, but has not been actively maintained and may lack support for newer Notion API changes.","status":"maintenance","version":"0.6.9","language":"javascript","source_language":"en","source_url":"https://github.com/mayneyao/gatsby-source-notion-database","tags":["javascript"],"install":[{"cmd":"npm install gatsby-source-notion-database","lang":"bash","label":"npm"},{"cmd":"yarn add gatsby-source-notion-database","lang":"bash","label":"yarn"},{"cmd":"pnpm add gatsby-source-notion-database","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Gatsby is required as the framework; plugin only works within a Gatsby project.","package":"gatsby","optional":false},{"reason":"Notion SDK for API calls; installed as a peer dependency.","package":"@notionhq/client","optional":false}],"imports":[{"note":"This is a Gatsby plugin, not a regular npm module; it is configured in gatsby-config.js via resolve, not imported.","wrong":"import gatsbySourceNotionDatabase from 'gatsby-source-notion-database'","symbol":"gatsby-source-notion-database","correct":"module.exports = { plugins: [{ resolve: `gatsby-source-notion-database`, options: { sourceConfig: [...] } }] }"},{"note":"The GraphQL type is auto-generated from the 'name' option in sourceConfig; prefix 'all' is added automatically.","wrong":"query { allNotionPosts { ... } }","symbol":"all<Name>","correct":"query { allPosts { nodes { name } } }"},{"note":"This plugin does not export any functions; use standard Gatsby queries to access data.","wrong":"import { graphql } from 'gatsby-source-notion-database'","symbol":"notionDatabase","correct":"import { useStaticQuery, graphql } from 'gatsby'; const data = useStaticQuery(graphql`{ allBooks { nodes { ... } } }`)"}],"quickstart":{"code":"// gatsby-config.js\nmodule.exports = {\n  plugins: [\n    {\n      resolve: `gatsby-source-notion-database`,\n      options: {\n        sourceConfig: [\n          {\n            name: \"books\",\n            table: \"https://www.notion.so/workspace/abc123?v=xyz789\",\n            cacheType: \"static\"\n          }\n        ]\n      }\n    }\n  ]\n};\n\n// pages/index.js\nimport React from \"react\";\nimport { graphql } from \"gatsby\";\n\nexport const query = graphql`\n  query {\n    allBooks {\n      nodes {\n        name\n        tags\n      }\n    }\n  }\n`;\n\nconst IndexPage = ({ data }) => {\n  return (\n    <ul>\n      {data.allBooks.nodes.map(book => (\n        <li key={book.name}>{book.name}</li>\n      ))}\n    </ul>\n  );\n};\n\nexport default IndexPage;","lang":"javascript","description":"Configure the plugin with a Notion database table URL, then query the data in a Gatsby page using GraphQL."},"warnings":[{"fix":"Migrate to a plugin that supports Notion API v2 or use official Notion SDK.","message":"Plugin uses old Notion API (v1) which may stop working as Notion deprecates v1.","severity":"breaking","affected_versions":">=0.0.0"},{"fix":"Remove cacheType from sourceConfig or leave as static.","message":"cacheType option is deprecated — 'static' and 'dynamic' no longer have effect.","severity":"deprecated","affected_versions":">=0.5.0"},{"fix":"Ensure the table URL includes the '?v=...' query parameter from Notion.","message":"Table URL must be the full URL including view ID (?v=...). Missing view ID results in empty data.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Source all related databases in the sourceConfig array.","message":"Relation properties may not resolve correctly if the related database is also not sourced.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Set the environment variable NOTION_TOKEN with a valid integration token.","cause":"Invalid or missing Notion API token (not configured).","error":"Error: \"gatsby-source-notion-database\" threw an error while running: \"Cannot read property 'results' of undefined\""},{"fix":"Provide sourceConfig as an array of objects in gatsby-config.js.","cause":"sourceConfig option missing or not an array.","error":"TypeError: sourceConfig is not iterable"},{"fix":"Ensure the name option (e.g., 'books') matches the GraphQL query prefix (allBooks).","cause":"The sourceConfig 'name' does not match the query name.","error":"GraphQL Error: Unknown type 'allBooks'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}