evitaDB icon indicating copy to clipboard operation
evitaDB copied to clipboard

Allow specification of `inScope` in extra results

Open novoj opened this issue 2 months ago • 0 comments

Currently the inScope constraint is not supported in extraResults of GraphQL / REST API even if the basic evitaQL allows it. This means we're not able to specify query for entities in multiple scopes and calculating a hierarchy tree for only LIVE scope. The engine would complain that it cannot generate hierarchy result from two scopes - which is true, but there is no way how to instruct it, that we want only the LIVE scope to be used for hierarchy tree calculations.

Example query:

{
  queryProduct(
    filterBy: {    
      hierarchyCategoriesWithin: {
        ofParent: {
          attributeCodeEquals: "audio"
        }      
      },
      scope: [LIVE, ARCHIVED]
    }
  ) {
    extraResults {
      inScope(scope: LIVE) {
        hierarchy {        
          categories {
            megaMenu: fromRoot(
              stopAt: {
                level: 2
              }
            ) {
              level
              entity {
                primaryKey
                attributes {
                  code
                }
              }
              requested
              queriedEntityCount
              childrenCount
            }
          }
        }    
      }
    }
  }
}

novoj avatar Oct 08 '25 10:10 novoj