Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for connection with multiple aliases #393

Closed
wants to merge 5 commits into from

Conversation

dmoree
Copy link
Contributor

@dmoree dmoree commented Aug 5, 2021

Description

Similar to #359, this adds the ability to have multiple aliases on connection fields without overwriting parameters by naming parameters after aliases and fields after names.

Issue

Checklist

The following requirements should have been met (depending on the changes in the branch):

  • Documentation has been updated
  • TCK tests have been updated
  • Integration tests have been updated
  • Example applications have been updated
  • New files have copyright header
  • CLA (https://neo4j.com/developer/cla/) has been signed

@darrellwarde
Copy link
Contributor

Hey @dmoree, thanks for this! This seems to have introduced a bug, highlighted in TCK test https://github.com/dmoree/graphql/blob/bugfix/alias-connection/packages/graphql/tests/tck/tck-test-files/cypher/connections/mixed-nesting.md#connection---connection---relationship

Where it is expecting Cypher arguments:

{
    "this_title": "Forrest Gump",
    "this_actor_movie_actors_name_NOT": "Tom Hanks",
    "this_actorsConnection": {
        "args": {
            "where": {
                "node": {
                    "name": "Tom Hanks"
                }
            }
        },
        "edges": {
            "node": {
                "moviesConnection": {
                    "args": {
                        "where": {
                            "node": {
                                "title_NOT": "Forrest Gump"
                            }
                        }
                    }
                }
            }
        }
    }
}

It is receiving:

{
    "this_title": "Forrest Gump",
    "this_actor_movie_actors_name_NOT": "Tom Hanks",
    "this_actorsConnection": {
        "args": {
            "where": {
                "node": {
                    "name": "Tom Hanks"
                }
            }
        },
        "edges": {
            "node": {
                "moviesConnection": undefined
            }
        }
    }
}

Seems like the movieConnection argument is now being dropped at some point.

@dmoree
Copy link
Contributor Author

dmoree commented Aug 9, 2021

I apologize since I am not sure how to remedy this. I don't want to pollute the repo, however I created a different pull request #403 that makes the same changes to createConnectionAndParams and adds additional integration and tck tests which are passing.

@dmoree dmoree closed this Aug 9, 2021
@dmoree dmoree deleted the bugfix/alias-connection branch August 10, 2021 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Attributes get lost when calling a connection multiple times using aliases
3 participants