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 skip population of individual joins, execute access for joins, sanitizeJoinQuery #8992

Merged
merged 4 commits into from
Nov 4, 2024

Conversation

r1tsuu
Copy link
Member

@r1tsuu r1tsuu commented Nov 2, 2024

What?

PR to #8973

Resets all changes in validateQueryPaths, validateSearchParams, getLocalizedPaths
Instead uses new sanitizeJoinQuery that does following:

  • Validates where for each join
  • Executes access for the joined collection
  • Combines join's where with the access result and join's default where
  • Moves default join's where handling to sanitizeJoinQuery

Adds ability to skip population of an individual join via joins[schemaPath] = false. This is also used internally if executeAccess returned false.

payload.find({
  collection: categoriesSlug,
  where: {
    id: { equals: category.id },
  },
  joins: {
    relatedPosts: false,
  },
})

@DanRibbens DanRibbens merged commit 4266ab6 into feat/join-field-where Nov 4, 2024
48 checks passed
@DanRibbens DanRibbens deleted the chore/join-where-move-logic branch November 4, 2024 20:43
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.

2 participants