-
Notifications
You must be signed in to change notification settings - Fork 87
Open
Labels
questionFurther information is requestedFurther information is requested
Description
I have the following typescript type:
export type StrapiPage = {
parent?: Strapi4ResponseSingle<StrapiPage>;
localizations?: Strapi4ResponseMany<StrapiPage>;
}
Then, when i try to run a find with the following filter to get all pages without a parent.
return {
parent: {
slug: {
$null: true
}
}
};
the following error occurs:
Object literal may only specify known properties, and 'slug' does not exist in type 'StrapiPrimitiveOperators | { data?: { id?: StrapiPrimitiveOperators | StrapiNumberOperators | undefined; attributes?: { ...; } | undefined; meta?: { ...; } | undefined; } | undefined; meta?: { ...; } | undefined; }'.
If i write it like this, the error is gone, but ofcourse the filters don't work anymore:
return {
parent: {
data: {
attributes: {
slug: {
$null: true
}
}
}
}
};
I understand this is because the return value/structure is different from the filter structure, but i'm not sure how to fix this in my StrapiPage type?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested