-
Notifications
You must be signed in to change notification settings - Fork 147
Empty list returned from nested filters, mis-assigned filter object #589
Comments
PR for temporary fix What I discovered: Example query:
As this object is built recursively the filters for the second sub query are applied first:
This gives us a final filter object of:
As a temporary fix I have added an additional parameter to This results in a filter object of:
This is a pretty hacky fix that is intended as a temporary solution (and to help explain the core issue). Our project is now using a fork with this fix and it is working as intended, but I understand there's likely a much better way to handle this. I'm also aware that you are planning on refactoring @michaeldgraham |
I've recently run into a bug which causes the first list of a sub node of a query return as empty.
We are using:
neo4j-graphql-js: ^2.19.2
apollo-server: ^2.20.0
neo4j:4.1.1
(Docker)Tested through GraphQLPlayground
I've reduced my query into the simplest reproducible state, showing:
Example Query
Result 1
Enabling debug output shows the generated query:
With the filter object
Note in the filter for AverageHoursOverride,
WHERE ('department_schedule_averageHoursOverrides'.hours >= $1_filter.hours_gte
$1_filter.hours_gte does not exist (and instead this filter item takes the value of the first filter)
Result 2
By uncommenting
actuals
(another list), we get the response:Along with the generated query
And filter object
Again we have
WHERE ('department_schedule_averageHoursOverrides'.hours >= $3_filter.hours_gte)
where $3_filter.hours_gte is correct
Summary
It looks like something is causing the second filter item to be mis-assigned, taking the value of the first filter. This only occurs for the second filter, all subsequent filters take the correct value.
Please let me know if there's anymore information I can provide.
The text was updated successfully, but these errors were encountered: