-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 support for isRequired on Relationships #719
Comments
Also, we absolutely need some comprehensive testing around this (and uniqueness) in the same way we do for filter tests. |
It looks like there hasn't been any activity here in over 6 months. Sorry about that! We've flagged this issue for special attention. It wil be manually reviewed by maintainers, not automatically closed. If you have any additional information please leave us a comment. It really helps! Thank you for you contribution. :) |
Just got stung by this: keystone.createList('User', {
fields: {
name: { type: Text },
},
});
keystone.createList('Post', {
fields: {
author: {
type: Relationship,
ref: 'User',
isRequired: true,
}
}
}); The mutation createPost {
createPost(data:{}) {
id
author {
id
}
}
} Successfully creates a new item. I think the most basic implementation should at least:
|
We should update the docs until this is resolved. |
Hello! It looks like isRequired is not supported on relationships in Keystone v6 as well as v5. Is this the proper channel to hear updates on this, given that the issue is closed, or should I open a new feature request issue? |
Hi @christopherliu, There is an open discussion around this at #7310. |
Due to the use of back-references, the
isRequired
flag is tricky to enforce for Relationship fields. At the moment I don't believe it's adequately implemented. This tasks needs someone to go through the Relationship field and ensure that theisRequired
semantics are correctly implemented across all use cases.The text was updated successfully, but these errors were encountered: