-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
Milestone
Description
Steps to reproduce
Detailed steps are in issue #4332
Current Behavior
Belongs-To resolver tries to fetch objects for foreign keys by constructing an IN clause (the juggler does this on behalf of the resolver). If a foreign key has NULL value the constructed IN clause has a NULL value in it. This may result in errors in certain conditions Edit: This is causing failures in Postgres (issue #4332). When Postgres queries with null value id, it throws: error: DEFAULT is not allowed in this context.
Expected Behavior
NULL values in foreign keys need not be queried (edit) or should be handled well as MySQL does, unless we are allowing for logical relations to be defined where the foreign key is just a string value and may not refer to a primary key of another table.
Link to reproduction sandbox
Provided in issue #4332
Acceptance criteria
- Fix Postgres connector to handle the case when
nullvalues are passed in- example:
Order {id: 1, customerId: null}, {id: 2, customerId: 1}. When traverseOrderwith inclusion, Postgres should handle the null fk properly.
- example:
- fix querying related entities with null keys and add related tests to
repository-test - check if
MongoandMySQLconnectors handles this case.
shaheero