Skip to main content
edited tags
Link
Anastasiya
  • 691
  • 4
  • 11
Source Link
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