这是indexloc提供的服务,不要输入任何密码
Skip to content

when filtering related collection need to include nested fields in comparison #171

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

Conversation

hallettj
Copy link
Collaborator

@hallettj hallettj commented Jul 4, 2025

This comes up when filtering on a nested field in a related collection. For example, where there is a relation from comments to movie:

query {
  comments(where: {movie: {imdb: {rating: {_eq: 9.2}}}}) {
    text
    movie {
      title
      year
    }
  }
}

In this example no records are returned because imdb.rating is not in scope when during filtering where that where predicate is applied.

We already have logic in place to include columns in joins if they are needed for an expression. But that logic did not account for nested fields. This PR updates the query planner to recursively include nested fields as needed if they are used in expressions.

@hallettj hallettj requested a review from daniel-chambers July 4, 2025 00:14
@hallettj hallettj self-assigned this Jul 4, 2025
@hallettj hallettj merged commit fd57be2 into v1 Jul 4, 2025
2 checks passed
@hallettj hallettj deleted the jessehallett/eng-1797-investigate-and-resolve-mongodb-connector-query-response branch July 4, 2025 04:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants