Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Add support for multiple databases #24

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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.

None yet

2 participants