OXEAN-133 Add nested relation filter opt-in - #1691
Open
GiuseppeXD wants to merge 4 commits into
Open
Conversation
GiuseppeXD
commented
Aug 20, 2026
| end | ||
| end | ||
|
|
||
| Relation.relations_of(model).each do |name, relation| |
Author
There was a problem hiding this comment.
Before graphoid added every Mongoid association to the generated filter inputs.
input AttachmentFilter {
record: RecordFilter
}
input RecordFilter {
attachments_some: AttachmentFilter
attachments_none: AttachmentFilter
attachments_every: AttachmentFilter
}Now, graphql-ruby rejects these during static schema validation:
attachments(where: { record: { id_not: null } }) {
data { id }
}InputObject 'AttachmentFilter' doesn't accept argument 'record'
GiuseppeXD
commented
Aug 20, 2026
|
|
||
| association_name = self.class.const_get(:ASSOCIATION_NAME) | ||
| result = obj.send(association_name) | ||
| result = processor.execute(result, where) if where.present? |
Author
There was a problem hiding this comment.
No longer executes or validates
records {
data {
attachments(where: { type: "picture" }) {
id
}
}
}However, other operations are still viable
records {
data {
attachments(limit: 10, skip: 0, order: { id: ASC }) {
id
}
}
}
niltonvasques
requested changes
Aug 20, 2026
niltonvasques
left a comment
There was a problem hiding this comment.
Instead remove the feature from graphoid, lets toggle on/off with an attribute.
In postman this feature is useful in specific situations: records { where: { sheet: { key: "...." }} or sheets: { project: { name: "test"
GiuseppeXD
commented
Aug 20, 2026
Author
There was a problem hiding this comment.
This tells Mongoid to allow the new type of param in the association
GiuseppeXD
force-pushed
the
oxean-133-remove-relation-filter-syntax
branch
from
August 24, 2026 18:37
f12b20b to
4b3e4e7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description ✍️
Make nested relation filters opt-in. Graphoid no longer generates relation filter arguments unless the association declares
graphoid_nested_filter: true.Generated to-many relation fields continue to exclude
where, preventing selected relation filters from entering Graphoid's processor.Overview 🔍
The option is consumed before Mongoid validates association options, then retained on the association reflection for Graphoid schema generation.
Unflagged relations, including
_some,_none, and_everycollection filters, remain absent from generated input types. Selected relation fields retainorder,limit, andskip, but do not exposewhere.Checks ☑️
relation_filter_restrictions_spec.rb: 6 examples, 0 failuresbelongs_torelation filterwhereare rejectedgit diff --checkpass