Transforming Invalid Filters Before Emission in Directus (Requires Source Code Changes)

I’m working on customizing the system filter interface in Directus and need help with modifying emitted filters before they are validated and synced.

What I’m Trying to Achieve

When a user selects a filter like:

{
  "user_created": {
    "_contains": "smith"
  }
}

This is invalid in Directus because user_created is a relational field. I want to automatically rewrite it to:

{
  "user_created": {
    "first_name": {
      "_contains": "smith"
    }
  }
}

So the user experience stays clean, but the filter is valid and functional behind the scenes.

What I’ve Tried

I’m attempting to intercept the emitted filters like this:

set(newVal) {
  console.log('Intercepting raw filters', newVal);
  emit('update:filter', newVal.map((val) => val.node));
}

But this doesn’t get triggered if the filter is invalid — it seems like Directus blocks the emission entirely if the filter is structurally wrong.

:speech_balloon: My Question

How can I intercept and modify the raw filter before Directus validates it, even if the structure is invalid?

I don’t want to override the UI — just rewrite the filter object programmatically before it’s emitted, so it becomes valid.

Any guidance, pointers to the right lifecycle hook, or internal utility to tap into would be greatly appreciated! :folded_hands: