1

I have a Headless Sitecore .NET Rendering SDK solution very close to the helix example solution.

I can access the playground through: /sitecore/api/graph/edge/ui

Queries such as the following work fine and return results:

query {
  item(path: "/sitecore/content/Site1", language: "en") {
        name
    children{
      results {
        id
        name
      }
    }
  }
}

However, when I try to make use of the "search" I get no results

For example:

query {
  search(
    where: {
      AND: [
        { name: "_hasLayout", value: "true" }
      ]
    }
    first: 10
  ) {
    results {
      id
      name
    }
  }
}

This returns the following:

{
  "data": {
    "search": {
      "results": []
    }
  }
}

Why would I be getting no results?

4
  • Try rebuilding your indexes
    – Richard Seal
    Apr 5 at 15:31
  • @RichardSeal thank you. Ultimately it was combination of things but indeed I didn't have the indexes populated, this helped.
    – Nexus IPX
    Apr 8 at 8:21
  • Yes, it's a bug, Thanks for sharing the link of my blog @chirag, I faced same issue and things are given on the blog. Do let me know if you need further help. Apr 8 at 8:26
  • Please don't add "thank you" as an answer. Instead, vote up the answers that you find helpful. - From Review
    – Anna Gevel
    Apr 8 at 11:23

1 Answer 1

2

There was bug reported on this with the _hasLayout query not working in GraphQL. Bug reference id for the same was 551736.

In the backend the issue was solr query was not getting created properly when sending _hasLayout parameter.

You can find more details on the same here.

https://daivagnananavati.blogspot.com/2023/10/sitecore-xm-with-cd-bug-haslayout.html

Hope this helps!!!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.