evitaDB icon indicating copy to clipboard operation
evitaDB copied to clipboard

GraphQL/REST APIs allow EntityProperty constraint but evitaDB doesn't

Open lukashornych opened this issue 1 year ago • 2 comments

We've found out that GraphQL and REST APIs allow entityProperty order constraint inside a referenceProperty constraint like so. But this throw an error because core of evitaDB doesn't support such deep ordering.

So far, I think the mistake is in the GQL/REST constraint schema builder because we don't have indexes for such deep ordering, but it needs to be discussed.

lukashornych avatar Mar 12 '24 06:03 lukashornych

Yes, currently the ordering can only be done on the data of the queried entity. We could go deeper, but still the references have to have the cardinality ONE_TO_ZERO_OR_ONE or ONE_TO_EXACTLY_ONE, otherwise the ordering would make no sense. So the GraphQL schema would have to limit the ordering of the entity properties to references of that cardinality.

I propose to limit the GraphQL query language to the current capabilities of the core engine in this issue, and open a new issue where we extend the ordering to nested entities of the mentioned cardinality.

novoj avatar Mar 13 '24 08:03 novoj

Yes, I agree, I came to the same conclusion with the cardinalities.

lukashornych avatar Mar 14 '24 06:03 lukashornych