Cosium / spring-data-jpa-entity-graph

Spring Data JPA extension allowing full dynamic usage of EntityGraph on repositories
MIT License
466 stars 51 forks source link

Is there any Support for attributeNodes for Dynamic Entity Graphs? #71

Closed krisiye closed 1 year ago

krisiye commented 1 year ago

Similar to attributePaths (EntityGraphUtils.fromAttributePaths), is there any support for dynamically adding attribute nodes? At the moment under my use-case I am able to use Dynamic Entity Graphs based on my request (graphql) and select the right set of EntityGraphs to load which is great. However, we end up loading all columns on the entity when the request really only needs a few. Although graphql optimizes this by only sending back what we ask for over the wire, It would also be nice to only ask for what we need from the database as opposed to all attributes on an Entity.

I know I can do that with NamedEntityGraphs by adding attribute Nodes along with the Fetch strategy. Wondering if there is a similar mechanism to achieve the same results with Dynamic Entity Graphs.

Appreciate your feedback!

reda-alaoui commented 1 year ago

Looks like a duplicate of #24 ?