Skip to content
This repository was archived by the owner on Sep 3, 2021. It is now read-only.

Relationship API bug fixes & updates #481

Merged
merged 15 commits into from
Jul 24, 2020
Merged

Relationship API bug fixes & updates #481

merged 15 commits into from
Jul 24, 2020

Conversation

michaeldgraham
Copy link
Collaborator

@michaeldgraham michaeldgraham commented Jul 23, 2020

This PR includes various bug fixes that open up API features for interfaced @relation type fields, as well as some fixes to long-standing bugs with relationship field orderBy arguments.

Interfaced relationship types

#142 - Relationship with properties doesn't build with interface types.
The schema augmentation process now handles @relation types that use an interface type for either or both of it's incoming and outgoing node types.

#201 - Cannot generate multi-type relationships
The custom error shown at the bottom of this issue has been removed and the Add, Remove, Update, and Merge relationship type mutations are now generated and translated, shown with these tests:

Filtering

#477 - [Regression] 2.14.4 Breaks Nested Filters Previously Working in 2.14.0
Beginning with issue #446 and proceeding into #409, this issue arose due to a misinterpretation of the direction to use when querying the incoming nodes of a relationship type from the outgoing type node. The initial fix in #469 was incorrect and has been revised and covered by the following tests:

#409 - Nested Filters do not work as expected for Interface types

Ordering

#173 - [BUG] Nested ordering errors
#272 - [Suggestion] Ordering by temporal field in relations
#373 - DateTime Ordering Argument Not Impacting Order
For quite some time, there has been a bug in nested ordering that causes it to silently fail when not also selecting the same fields being ordered. This issue was a result of misinterpreting how to handle the limitation of using apoc.coll.sortMulti and has been resolved in this PR. The translation strategy developed based on the misunderstanding was relied on in some post-processing code used for temporal ordering, so it showed up explicitly as a translation error in those cases.

#232 - Add first, offset, orderBy generated arguments for relationship type fields
The first, offset, and orderBy query arguments are now added to @relation type fields and translated according to the below tests:

Relevant remaining issues

#218 - Relationship mutation wrong return when only "to" fields are requested

used when adding selections for unselected ordered fields
updates buildQueryFieldArguments to support appropriate type names for filtering vs ordering argument types
adds getTypeDefiningField to support appropriate translation of relationship type fields when querying incoming nodes of the .from field in a sub-selection of the .to field, or visa versa
…rdering

also updates function arguments for the @relation field and type translation functions for use in support for ordering
updates decideRelationFilterMetadata to better determine the direction of the relationship path pattern used when filtering relationship type fields
@Phylodome
Copy link

Any idea as to when this PR's (much anticipated) changes will be published as an updated package version?

@johnymontana
Copy link
Contributor

@Phylodome it's now been published in v2.15.0

@Phylodome
Copy link

Wonderful. Thanks for the update!

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
3 participants