DEV Community

Philipp Jost
Philipp Jost

Posted on

`createSchemaCustomization` duplicates type instead of a merge.

i want to complement my infered types via the createTypes API like so:

exports.createSchemaCustomization = ({ actions }) => {
  const { createTypes } = actions
  const typeDefs = `
    type SiteSiteMetadataSecondaryNavItems implements Node @infer {
      childItems: [SiteSiteMetadataSecondaryNavItemsChildItems]
    }
    type SiteSiteMetadataSecondaryNavItemsChildItems @infer {
      title: String
      icon: String
      href: String
    }
  `
  createTypes(typeDefs)
}

it's very close to the Frontmatter snippet from the docs but i get:

Error: Schema must contain uniquely named types but contains multiple types named "SiteSiteMetadataSecondaryNavItems".

"gatsby": "^2.13.8",

Oldest comments (0)