@Query not returning all data in Spring boot with Spring data neo4j

I have the query below in a Spring boot application using Spring data neo4j. When I run the query as a standalone cypher query, it returns all the data that I am looking for, however, when I run the same query in the spring boot application, it does not return all the data I need. It just goes about a level or 2 deep.

 MATCH path = (stepNode:StepNode {stepNodeId: "<id_goes_here>"})-[:PARENT*0..]-(descendant)
   WITH collect(path) AS paths, stepNode, collect(distinct descendant) AS descendants
   UNWIND descendants AS d
   OPTIONAL MATCH (d)-[r]->(related)
   RETURN stepNode, paths, collect(distinct r) AS relationships, collect(distinct related) AS relatedNodes;

Is there anything I am missing?

This is the query in the spring boot repository

 @Query("""
        MATCH path = (stepNode:StepNode {stepNodeId: "421d419a-05a5-4cd6-81f5-3fe5336eead0"})-[:PARENT*0..]-(descendant)
        WITH collect(path) AS paths, stepNode, collect(distinct descendant) AS descendants
        UNWIND descendants AS d
        OPTIONAL MATCH (d)-[r]->(related)
        RETURN stepNode, paths, collect(distinct r) AS relationships, collect(distinct related) AS relatedNodes;
     """)
    Optional<StepNode> findTreeByRootNodeId(UUID rootNodeId);

I have also noticed that in my logs, right before my query is executed, spring data neo4j displays some data that matches the element_ids of the data that I am able to retrieve from a related entity. Below is the data that is pulled before my query runs with the query

2024-06-22T13:57:45.591Z DEBUG 752174 --- [Game Engine] [nio-9000-exec-1] org.springframework.data.neo4j.cypher    : Executing:
MATCH (rootNodeIds:`Product`) WHERE elementId(rootNodeIds) IN $rootNodeIds WITH collect(rootNodeIds) AS n OPTIONAL MATCH ()-[relationshipIds]-() WHERE elementId(relationshipIds) IN $relationshipIds WITH n, collect(DISTINCT relationshipIds) AS __sr__ OPTIONAL MATCH (relatedNodeIds) WHERE elementId(relatedNodeIds) IN $relatedNodeIds WITH n, __sr__ AS __sr__, collect(DISTINCT relatedNodeIds) AS __srn__ UNWIND n AS rootNodeIds WITH rootNodeIds AS product, __sr__, __srn__ RETURN product AS __sn__, __sr__, __srn__
2024-06-22T13:57:45.591Z TRACE 752174 --- [Game Engine] [nio-9000-exec-1] org.springframework.data.neo4j.cypher    : with parameters:
:param rootNodeIds => ['4:e980bb06-70fe-4527-9e8e-20567526a367:547']
:param relatedNodeIds => ['4:e980bb06-70fe-4527-9e8e-20567526a367:551', '4:e980bb06-70fe-4527-9e8e-20567526a367:557', '4:e980bb06-70fe-4527-9e8e-20567526a367:555', '4:e980bb06-70fe-4527-9e8e-20567526a367:553', '4:e980bb06-70fe-4527-9e8e-20567526a367:556', '4:e980bb06-70fe-4527-9e8e-20567526a367:554', '4:e980bb06-70fe-4527-9e8e-20567526a367:552', '4:e980bb06-70fe-4527-9e8e-20567526a367:561', '4:e980bb06-70fe-4527-9e8e-20567526a367:559', '4:e980bb06-70fe-4527-9e8e-20567526a367:556', '4:e980bb06-70fe-4527-9e8e-20567526a367:554', '4:e980bb06-70fe-4527-9e8e-20567526a367:553', '4:e980bb06-70fe-4527-9e8e-20567526a367:557', '4:e980bb06-70fe-4527-9e8e-20567526a367:555', '4:e980bb06-70fe-4527-9e8e-20567526a367:553', '4:e980bb06-70fe-4527-9e8e-20567526a367:556', '4:e980bb06-70fe-4527-9e8e-20567526a367:554', '4:e980bb06-70fe-4527-9e8e-20567526a367:552', '4:e980bb06-70fe-4527-9e8e-20567526a367:551', '4:e980bb06-70fe-4527-9e8e-20567526a367:556', '4:e980bb06-70fe-4527-9e8e-20567526a367:554', '4:e980bb06-70fe-4527-9e8e-20567526a367:552', '4:e980bb06-70fe-4527-9e8e-20567526a367:556', '4:e980bb06-70fe-4527-9e8e-20567526a367:554', '4:e980bb06-70fe-4527-9e8e-20567526a367:551', '4:e980bb06-70fe-4527-9e8e-20567526a367:561', '4:e980bb06-70fe-4527-9e8e-20567526a367:559']
:param relationshipIds => ['5:e980bb06-70fe-4527-9e8e-20567526a367:96', '5:e980bb06-70fe-4527-9e8e-20567526a367:291', '5:e980bb06-70fe-4527-9e8e-20567526a367:342', '5:e980bb06-70fe-4527-9e8e-20567526a367:287', '5:e980bb06-70fe-4527-9e8e-20567526a367:275', '5:e980bb06-70fe-4527-9e8e-20567526a367:341', '5:e980bb06-70fe-4527-9e8e-20567526a367:274', '5:e980bb06-70fe-4527-9e8e-20567526a367:345', '5:e980bb06-70fe-4527-9e8e-20567526a367:344', '5:e980bb06-70fe-4527-9e8e-20567526a367:289', '5:e980bb06-70fe-4527-9e8e-20567526a367:343', '5:e980bb06-70fe-4527-9e8e-20567526a367:306', '5:e980bb06-70fe-4527-9e8e-20567526a367:305', '5:e980bb06-70fe-4527-9e8e-20567526a367:326']
2024-06-22T13:57:45.653Z DEBUG 752174 --- [Game Engine] [nio-9000-exec-1] o.s.d.n.c.t.Neo4jTransactionManager      : Initiating transaction commit
2024-06-22T13:57:45.662Z  INFO 752174 --- [Game Engine] [nio-9000-exec-1] c.l.d.g.c.game.TemplateController        : [8A26299413CCEF2FB715D1D610E91EF6] product found, about to check for root node
2024-06-22T13:57:45.662Z DEBUG 752174 --- [Game Engine] [nio-9000-exec-1] o.s.d.n.c.t.Neo4jTransactionManager      : Creating new transaction with name [com.lucidarray.d_and_c.game_engine.services.game.StepNodeService.findTreeById]: PROPAGATION_REQUIRES_NEW,ISOLATION_DEFAULT; 'transactionManager'
2024-06-22T13:57:45.674Z DEBUG 752174 --- [Game Engine] [nio-9000-exec-1] o.s.d.n.c.t.Neo4jTransactionManager      : Participating in existing transaction
2024-06-22T13:57:45.674Z DEBUG 752174 --- [Game Engine] [nio-9000-exec-1] org.springframework.data.neo4j.cypher    : Executing:
   MATCH path = (stepNode:StepNode {stepNodeId: "421d419a-05a5-4cd6-81f5-3fe5336eead0"})-[:PARENT*0..]-(descendant)
   WITH collect(path) AS paths, stepNode, collect(distinct descendant) AS descendants
   UNWIND descendants AS d
   OPTIONAL MATCH (d)-[r]->(related)
   RETURN stepNode, paths, collect(distinct r) AS relationships, collect(distinct related) AS relatedNodes;

2024-06-22T13:57:45.675Z TRACE 752174 --- [Game Engine] [nio-9000-exec-1] org.springframework.data.neo4j.cypher    : with parameters:
:param 0 => "421d419a-05a5-4cd6-81f5-3fe5336eead0"
:param rootNodeId => "421d419a-05a5-4cd6-81f5-3fe5336eead0"
2024-06-22T13:57:45.705Z DEBUG 752174 --- [Game Engine] [nio-9000-exec-1] o.s.d.n.c.t.Neo4jTransactionManager      : Initiating transaction commit

The data that I get when I run the query directly in cypher (I used the table because it might be easier to compare than the graph)

I am using spring boot 3.2.5 and the spring-boot-starter-data-neo4j compatible with it

Any help would be appreciated

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật