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

Improve disambiguation error message #1412

Merged
merged 2 commits into from
Nov 17, 2019

Conversation

steve-chavez
Copy link
Member

As noted in #1358 (comment) we had the relationships backward(getting the cardinality from parent to child) on the request tree. This made things really confusing, not only for development/debugging but also for error reporting. With this change, we now get a better error message for disambiguation(added in #1401).

GET /message?select=*,sender(*)
{
  "details": [
    {
        "cardinality": "many-to-one",
        "source": "test.message[sender]",
        "target": "test.person[id]"
    },
    {
        "cardinality": "many-to-one",
        "source": "test.message[sender]",
        "target": "test.person_detail[id]"
    }
  ],
  "hint": "Disambiguate by choosing a relationship from the `details` key",
  "message": "More than one relationship was found for message and sender"
}

Also renamed the cardinality types from Parent/Child to the more proper O2M/M2O. Parent and Child terms are usually meant for referring to the ends of a relationship and not the cardinality.

* reverse backwards relationships
* remove redundancy from getJoinSelects
* properly name Cardinality constructors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant