I am trying to sort a query based on a nested property but cannot seem to do so. My schema is:
type Question {
_id: ID! @id
index: Int!
text: String!
marks: Int!
paper: ExamPaper! @relationship(type: "ExamPaper_Questions", direction: IN)
}
and I would like to query questions and sort by paper.date like:
query {
questions(options: { sort: [{ paper: { date: ASC } }] }) {
text
paper {
date
}
}
}
But this is not allowed as only direct properties are allowed on the options.sort (so paper is not defined)
And while I can add a sort as part of the paper property, that obviously doesnt do the same thing (actually doesnt do anything given there is a single paper connection)
Is this possible to do? Perhaps using paperConnection?
Ok, I will track that issue.
On removal of 1:1 relationships, is there any documentation on the reasoning for this and recommended replacement in v7 (on)? I searched in issues but nothing came up? I found this:Neo4j GraphQL Library: Our Roadmap for 2024–2025 but would be good to read more if there is material available?
Off topic, but I also saw about the deprecation of OGM - if there are any discussions of how use cases that required OGM should be handled, ie by treating any resolvers that then used OGM as a middleware instead and calling GQL endpoints using say apollo client instead, that would be great as I have a couple of places where I am using OGM
First I would like to say that if there is a reason you can't move on to version 6 then by all means you should feel it is OK to stay on version 5 of the library. Version 5 has become LTS (long-term supported) and we will therefore be addressing bugs which occur there.
OGM will remain in version 5 and not be brought forward with newer versions of the library until we have looked at it from a more strategic, company-wide standpoint. Please see our response on GitHub.
On the removal of 1:1 relationships, our reasoning is that this is not a feature of the database. We have been trying for a while to make this work in the library, but it was always a struggle against what was supported. Our recommendation is, if you find this to be an important feature then it should be raised as a feature request in the Neo4j database repository.