-
Notifications
You must be signed in to change notification settings - Fork 147
fix: do not assign undefined to x_filter keys #281
Conversation
Codecov Report
@@ Coverage Diff @@
## master #281 +/- ##
==========================================
+ Coverage 95.04% 95.47% +0.42%
==========================================
Files 10 10
Lines 2341 2341
==========================================
+ Hits 2225 2235 +10
+ Misses 116 106 -10
Continue to review full report at Codecov.
|
Thanks @tungv - could you please add a test with a query showing an example of what this fixes? I'd like to make sure we get it into the test suite and don't inadvertently revert the fix. |
I will need some time to get familiar with the test structure. But I think it's doable. |
@tungv Great thanks! Currently, all the filtering tests are generated from this markdown file. So you can just add a couple of tests at the end of the file using the same markdown format showing one of the GraphQL queries for the test schema that would have failed without your fix. l L Let me know if you have any issues with it. |
Hey Johny, very appreciated! The bug I found happened when you have filters for a subpath of an unfiltered path. I will look to reproduce it from the schema in test. |
Great - thanks @tungv, you can also just add an example of a failing query in this thread and I can adapt it to the test schema and add to the tests. |
hi @johnymontana I added a new test on the rebased codebase to reflect the bug but I'm not sure if that is the best place to add that test. |
Thanks @tungv! So since this applies to filters on nested relationship types I can see why you weren't able to adopt it to the schema used in the existing filter tests (since that schema doesn't have any nested relationship types). I'll go ahead and merge this in, but move the test you added to a new test file, with the goal of eventually moving it to our filter tests with a more complex schema. Thanks, again! |
Thank you for merging William. How long does it usually take to an npm release? |
Thanks for the PR! I did a release yesterday so this is in v2.7.2 🎉 |
thank you @johnymontana |
if x_filter is accidentally assigned with
undefined
value, the following code(https://github.com/neo4j-graphql/neo4j-graphql-js/blob/master/src/selections.js#L80)
will delete previously built filter params.