neo4j-graphql / neo4j-graphql-java

Neo4j Labs Project: Pure JVM translation for GraphQL queries and mutations to Neo4j's Cypher
Apache License 2.0
105 stars 49 forks source link

Creating parent query combining individual entities #314

Closed Palak-K9 closed 7 months ago

Palak-K9 commented 7 months ago

Discussed in https://github.com/neo4j-graphql/neo4j-graphql-java/discussions/313

Originally posted by **Palak-K9** April 3, 2024 I am trying to build and application using the example - [Spring Boot Graphql Example](https://github.com/neo4j-graphql/neo4j-graphql-java/tree/master/examples/graphql-spring-boot) I have **Neo4j Database** in which there are various node types like **Fruit, Sweet, Vegetable**. I have defined thier schema in **neo4j.graphql file**. and while running graphiql on browser, I can directly query these nodes with conditions. For example :- ```{ fruits{ name quantity } } ``` This query gives me the fruit nodes with the mentioned fields. I can query the individual entities but I want to get these entities under one name/query. I have tried defining the following in no4j.graphql ``` type Query { getItems: [Item] } type Item{ fruits: [Fruit] vegetables: [Vegetable] sweets: [Sweet] } ``` But this is not working. Could someone help me how can I acheive this
Andy2003 commented 7 months ago

I answered in the discussion #313