Allow populate
to accept field.name
#10357
yulolimum
started this conversation in
Feature Requests & Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello!
There are times when a collection (CollectionA) might have multiple relationship fields to the same (CollectionB). For example (this is a stupid example but bear with me):
When using
populate
, right now that affects all CollectionA relationship fields that point to CollectionB.What I am proposing is to be able to populate based on field name as well:
This example would produce a response like so:
I created a reproduction and patch as an example:
clone repo
install deps
start dev server
authenticate at https://localhost:3000/admin
go to: http://localhost:3000/users-w-posts-n-myposts-w-default-populate
go to: http://localhost:3000/users-w-posts-w-populate
go to http://localhost:3000/users-w-myposts-w-populate
apply patch
go to http://localhost:3000/users-w-myposts-w-populate
For visibility, this is the patch that attempts this functionality, although more changes are necessary to satisfy TS:
Beta Was this translation helpful? Give feedback.
All reactions