-
Notifications
You must be signed in to change notification settings - Fork 146
DateTime Ordering Argument Not Impacting Order #373
Comments
Hi @jonasdumas - could you please share the generated Cypher statement from your GraphQL query? Also, I wonder if this could be a bug related to fragments. Could you try the GraphQL query with using the |
Hi @johnymontana
No it's not related to fragments as you can see on the Playground printscreen. It's also not specific to DateTime such as it doesn't work with the body_asc (String). It's always the same order of records returned. |
@jonasdumas Looks like there was a bug with how we handled nested ordering when the field included an underscore character. I've pushed a fix and a release. Could you please try with the latest v2.11.4 and let us know if that fixes the issue for you? |
@johnymontana thanks for your return. Things changes with your last commit. Now we got an error in the GraphQL response:
The GraphQL query:
The CYPHER output is the following:
|
@jonasdumas are you using a I'm not able to reproduce it with the GraphQL schema you shared. Instead, for the query
the generated Cypher is MATCH (`post`:`Post` {ttuid:$ttuid})
RETURN `post` { .ttuid ,
comments:
[sortedElement IN apoc.coll.sortMulti([(`post`)-[:`HAS`]->(`post_comments`:`Comment`) | post_comments {
.body ,
created_at: `post_comments`.created_at}], ['^created_at']) | sortedElement { .*, created_at: {formatted: toString(sortedElement.created_at)}}][0..3] } AS `post` which includes data for the formatted field, so the |
Thanks @johnymontana. Right, in my previous comment, due to our tests, we had a temporary @cypher directive in our Schema definition in Post Schema who was at the origin of the error in the GraphQL playground. Thanks for pointing that. Here's (part of) our schema:
Our graphQL query:
Fragments:
Here's the graphql Error:
### => After few test, it seems to come from DateTime type. As if OrderBy (both) use body_asc it works. I noticed this at the end of the error message in the cypher output: It seems to be where it should have the created_at fields, right after the comma: But it's not there... |
As the GraphQL query work in the playground but not when it’s fired thru the app, do you have any idea why? Also, @johnymontana, your first remark/answer (in #353 ) to our bug alert was to directly point DateTime ordering issue, does it mean there’s already known issue on that? |
This is still an issue in 2.15.1. Getting "Resolve function for "_Neo4jDateTime.formatted" returned undefined" for this:
And this works fine: |
Hi @johnymontana
It doesn't work for us. We still have the problem with:
The following GraphqL query doens't change the order of the comments whatever we fill in orderBy: created_at_asc, created_at_desc, body_asc, body_desc
Any idea why?
We've now
neo4j-graphql-js@2.11.3
Originally posted by @jonasdumas in #353 (comment)
The text was updated successfully, but these errors were encountered: