query Suppliers($filters: SupplierFiltersInput, $certificationsFilters2: CertificationFiltersInput) {
suppliers(filters: $filters) {
data {
id
attributes {
companyName
recipient_organization {
data {
id
attributes {
name
certifications(filters: $certificationsFilters2) {
data {
id
}
}
}
}
}
}
}
}
}
some of the Suppliers have a recipient_organization that have a few deleted certifications
And they appear in the results. Unfortunately.
const sdWrapParams = async (defaultService: any, opts: any, ctx: { uid: string, action: string }) => {
const { uid, action } = ctx;
const wrappedParams = await defaultService.wrapParams(opts, ctx);
if (!plugin.supportsContentType(uid)) {
return wrappedParams;
}
// Prevent users to set values for _softDeletedAt, _softDeletedById, and _softDeletedByType
if (wrappedParams.data) {
delete wrappedParams.data._softDeletedAt;
delete wrappedParams.data._softDeletedById;
delete wrappedParams.data._softDeletedByType;
}
return {
...wrappedParams,
filters: {
$and: [
{
...wrappedParams.filters
},
{
_softDeletedAt: {
$null: true
},
},
],
},
};
}
_softDeletedAt: {
$null: true
},
apply only for top level entity.
I think would be good to get only non-deleted records.