Skip to main content
2 of 2
edited tags
Anastasiya
  • 691
  • 4
  • 11

Error in component using integrated GraphQL search query "Cannot read property search of undefined"

Component definition

export default function (manifest) {
  manifest.addComponent({
    name: 'Navigation',
    graphQLQuery: `
    query NavigationQuery {
      search(
        fieldsEqual: [
          { name: "_fullpath", value: "/sitecore/content/${packageJson.config.appName}/*" },
          { name: "_templatename", value: "App Route" }
        ]
      ) {
        results {
          items {
            item {
              name
              url
            }
          }
        }
      }
    }`
  });
}

Error when rendering component Error when rendering component

Anastasiya
  • 691
  • 4
  • 11