fix(): handle empty q filters - allow to query deleted records from graph API - staled_at fixes (#11544)
* fix(): Allow to query deleted records from graph API * fix(): Allow to query deleted records from graph API * handle empty q value * update staled at sync * rename integration tests file * Create strong-houses-marry.md * try to fix flacky tests * fix pricing context * update changeset * update changeset * fix import * skip test for now --------- Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
cfffd55ae6
commit
065df75e7d
@@ -2,11 +2,13 @@ import {
|
||||
Context,
|
||||
Event,
|
||||
IndexTypes,
|
||||
QueryGraphFunction,
|
||||
RemoteQueryFunction,
|
||||
Subscriber,
|
||||
} from "@medusajs/framework/types"
|
||||
import {
|
||||
MikroOrmBaseRepository as BaseRepository,
|
||||
CommonEvents,
|
||||
ContainerRegistrationKeys,
|
||||
deepMerge,
|
||||
InjectManager,
|
||||
@@ -210,13 +212,20 @@ export class PostgresProvider implements IndexTypes.StorageProvider {
|
||||
}
|
||||
|
||||
const { fields, alias } = schemaEntityObjectRepresentation
|
||||
const { data: entityData } = await this.query_.graph({
|
||||
|
||||
const graphConfig: Parameters<QueryGraphFunction>[0] = {
|
||||
entity: alias,
|
||||
filters: {
|
||||
id: ids,
|
||||
},
|
||||
fields: [...new Set(["id", ...fields])],
|
||||
})
|
||||
}
|
||||
|
||||
if (action === CommonEvents.DELETED || action === CommonEvents.DETACHED) {
|
||||
graphConfig.withDeleted = true
|
||||
}
|
||||
|
||||
const { data: entityData } = await this.query_.graph(graphConfig)
|
||||
|
||||
const argument = {
|
||||
entity: schemaEntityObjectRepresentation.entity,
|
||||
|
||||
Reference in New Issue
Block a user