Skip to content

Conversation

@viteinfinite
Copy link

Description

This PR adds support for querying multiple databases by adding a new nodeTypeName property.

In order to query multiple databases, you can add multiple gatsby-source-notion-api in your project’s gatsby-config.js and set different nodeTypeName values. For instance:

  plugins: [
    {
      resolve: `gatsby-source-notion-api`,
      options: {
        token: `$INTEGRATION_TOKEN`,
        databaseId: `$DATABASE_ID`,
        nodeTypeName: "notionTeamMember",
        propsToFrontmatter: true,
        lowerTitleLevel: true,
      },
    },
    {
      resolve: `gatsby-source-notion-api`,
      options: {
        token: `$INTEGRATION_TOKEN`,
        databaseId: `$DATABASE_ID`,
        nodeTypeName: "notionTask",
        propsToFrontmatter: true,
        lowerTitleLevel: true,
      },
    },
  ],

nodeTypeName is optional and defaults to "Notion", so the change is non-breaking.

Motivation and Context

#3

Screenshots

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Security fix (non-breaking change wich fixes a security issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as
    expected)

@Anahkiasen
Copy link

Would love to have this in, hope it gets merged soon 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants