directus-extension-generate-types icon indicating copy to clipboard operation
directus-extension-generate-types copied to clipboard

Syntax for deep filter

Open the-nicolas opened this issue 6 months ago • 0 comments

I added generated typescript types to my code and created client as written: const client = createDirectus<CustomDirectusTypes>("<directus url>").with(rest());

It works well, but how is now the correct typed syntax to do deep filters? I also get type mismatch errors:

return directus.request(
      readItems("collection", {
        deep: {
          translations: {
            _filter: {
              _and: [
                {
                  languages_code: { _eq: languageCode },
                },
              ],
            },
          },
        },
        ...

Is there any full sample?

the-nicolas avatar Aug 18 '24 10:08 the-nicolas