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

feat: add forceSelect collection / global config property #11627

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

r1tsuu
Copy link
Member

@r1tsuu r1tsuu commented Mar 11, 2025

What?

Adds a new property to collection / global config forceSelect which can be used to ensure that some fields are always selected, regardless of the select query.

Why?

This can be beneficial for hooks and access control, for example imagine you need the value of data.slug in your hook.
With the following query it would be undefined:
?select[title]=true
Now, to solve this you can specify

forceSelect: {
  slug: true
}

How?

Every operation now merges the incoming select with collectionConfig.forceSelect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant