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

Bug fixes for v2.16.0: Fragments, relationship types, and merge mutations #492

Merged
merged 12 commits into from
Aug 4, 2020
Merged

Bug fixes for v2.16.0: Fragments, relationship types, and merge mutations #492

merged 12 commits into from
Aug 4, 2020

Conversation

michaeldgraham
Copy link
Collaborator

@michaeldgraham michaeldgraham commented Aug 4, 2020

Query API


  • Relationship Types

    • Fixes Errors adding _id to @relation types #234 - Errors adding _id to @relation types

      When using relationship types, the Neo4j internal ID is now generated and translated appropriately. Corresponding _id_asc and _id_desc values are also generated for the relationship type's ordering enum. Because it is not recommended for unique selection, relationship field arguments are not generated for the _id field.

    • Fixes Error when schema contains array of properties on relationship  #490 - Error when schema contains array of properties on relationship,br>

      This issue occurred during augmentation, when generating the orderBy field argument and enum type for a relationship type that does not have at least one non-list scalar field. There is currently no support for for ordering list type scalar fields or relationship fields, so in such a case an ordering enum and its field argument should not be generated. Although the enum type was not being generated, corresponding field arguments on the given relationship field were, resulting in the error noted in the issue. It is also generally prevented by the fix for Errors adding _id to @relation types #234, given that relationship types will now have at least an _id field, and so at least _id_asc and _id_desc ordering fields. Until current behavior changes, the propertyFieldExists function in fields.js has been updated to directly fix this issue.

Mutation API

updates propertyFieldExists to return false for list type fields (a more elegant fix should be possible later after some refactoring)
separates the branching for update and merge mutations to allow types with only a primary key field and no updatable fields to pass through for merge mutation generation
instead of using Neo4jSystemIDField
Adds mergeSchemaTypeSelections to handle fragments used on the same type being queried. Selections get merged into any selections outside of fragments, to treat them as such in order to simplify over existing translation logic
@michaeldgraham michaeldgraham changed the title V2.16.0/2 Fragment, relationship type, and merge mutation fixes for v2.16.0 Aug 4, 2020
@michaeldgraham michaeldgraham changed the title Fragment, relationship type, and merge mutation fixes for v2.16.0 Bug fixes for v2.16.0: Fragments, relationship types, and merge mutations Aug 4, 2020
@johnymontana johnymontana merged commit 773c9f9 into neo4j-graphql:master Aug 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants