Description
While I am doing the last steps to also bring complete scrolling support for Spring GraphQL into Spring Data Neo4j, I came across this line:
Given a (partial) schema like this:
type Query {
movies(first:Int, after:String, last:Int, before:String): MovieConnection
}
type MovieConnection {
edges: [MovieEdge]!
pageInfo: PageInfo!
}
type MovieEdge {
node: Movie!
cursor: String!
}
type Movie {
id: ID!
#...
actors: [Person]
directors: [Person]
}
and an actual query like this:
{
movies(first:3){
pageInfo {
hasPreviousPage
hasNextPage
endCursor
}
edges {
cursor
node {
title
id
actors
{
name
}
}
}
}
}
The selection set of course contains the requested paths that does not match up with the entity (Movie
) at all. In fact the paths look like MovieConnection.edges/MovieEdge.node/Movie.actors . As a consequence buildPropertyPaths
will return 0 properties.
In Spring Data Neo4j we process those properties to reduce the amount of data and related nodes/entities that gets loaded. But in this case we can only return "everything" because there is no filter in place.
Would it be possible to make the method buildPropertyPaths
resp. the underlying methods aware of the cursor connection? Or issue another subsequent call before execution with this meta-information (I am aware that this would require a new method in Spring Data Commons)?