neos / neos-development-collection

The unified repository containing the Neos core packages, used for Neos development.
https://www.neos.io/
GNU General Public License v3.0
260 stars 221 forks source link

Flow Query Replacement #4922

Open bwaidelich opened 4 months ago

bwaidelich commented 4 months ago

Disclaimer: This issue is merely a collection of ideas, I don't think that we have to replace FlowQuery in the core as this can be explored with 3rd party packages first

While FlowQuery served us well in the past, it has some major drawbacks:

Some ideas

mhsdesign commented 4 weeks ago

Just that it doesnt get lost:

Following things were already experimented with:

Sitegeist.CriQuel

-> package https://github.com/sitegeist/Sitegeist.CriQuel

from @mficzel

$result = Query::create($documentNode)
  ->chain(new ReferencingNodesProcessor('taxonomyReferences', 'Sitegeist.Taxonomy:Taxonomy'))
  ->chain(new WithDescendantsProcessor('Sitegeist.Taxonomy:Taxonomy'))
  ->chain(new ReferencedByNodesProcessor('taxonomyReferences', 'Neos.Neos:Document'))
  ->chain(new UniqueProcessor())
  ->chain(new RemoveProcessor($documentNode))
  ->extract(new GetNodesExtractor());

or in fusion:

similarDocuments = ${crql(documentNode).referencingNodes('taxonomyReferences', 'Sitegeist.Taxonomy:Taxonomy').withDescendants('Sitegeist.Taxonomy:Taxonomy').referencedByNodes('taxonomyReferences', 'Neos.Neos:Document').unique().remove(documentNode).getNodes()}

Cypher

-> first draft https://github.com/neos/contentrepository-development-collection/tree/cypher

from @nezaniel

-[:ROOT]->(n:Sitegeist.Taxonomy:Vocabulary) for root nodes of type Vocabulary (n: {nodeAggregateId: 'org-starfleet-starfleetcommand'}) for a node by id