feat(index): add filterable fields to link definition (#11898)

* feat(index): add filterable fields to link definition

* rm comment

* break recursion

* validate read only links

* validate filterable

* gql schema array

* link parents

* isInverse

* push id when not present

* Fix ciruclar relationships and add tests to ensure proper behaviour (part 1)

* log and fallback to entity.alias

* cleanup and fixes

* cleanup and fixes

* cleanup and fixes

* fix get attributes

* gql type

* unit test

* array inference

* rm only

* package.json

* pacvkage.json

* fix link retrieval on duplicated entity type and aliases + tests

* link parents as array

* Match only parent entity

* rm comment

* remove hard coded schema

* extend types

* unit test

* test

* types

* pagination type

* type

* fix integration tests

* Improve performance of in selection

* use @@ to filter property

* escape jsonPath

* add Event Bus by default

* changeset

* rm postgres analyze

* estimate count

* new query

* parent aliases

* inner query w/ filter and sort relations

* address comments

---------

Co-authored-by: adrien2p <adrien.deperetti@gmail.com>
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
Carlos R. L. Rodrigues
2025-04-29 07:10:31 -03:00
committed by GitHub
parent 8a3f639f01
commit b868a4ef4d
37 changed files with 3285 additions and 755 deletions

View File

@@ -143,7 +143,7 @@ medusaIntegrationTestRunner({
)
expect(resultset.metadata).toEqual({
count: 2,
estimate_count: expect.any(Number),
skip: 0,
take: 10,
})

View File

@@ -59,7 +59,7 @@ async function populateData(
}
medusaIntegrationTestRunner({
testSuite: ({ getContainer, dbConnection, api, dbConfig }) => {
testSuite: ({ getContainer, dbConnection, api }) => {
let indexEngine: IndexTypes.IIndexService
let appContainer

View File

@@ -93,6 +93,7 @@ medusaIntegrationTestRunner({
;(indexEngine as any).storageProvider_.onApplicationStart = jest.fn()
// Trigger a sync
;(indexEngine as any).schemaObjectRepresentation_ = null
await (indexEngine as any).onApplicationStart_()
// 28 ms - 6511 records
@@ -138,6 +139,7 @@ medusaIntegrationTestRunner({
;(indexEngine as any).storageProvider_.onApplicationStart = jest.fn()
// Trigger a sync
;(indexEngine as any).schemaObjectRepresentation_ = null
await (indexEngine as any).onApplicationStart_()
const { data: results } = await indexEngine.query<"product">({
@@ -172,8 +174,8 @@ medusaIntegrationTestRunner({
}
`,
}
// Trigger a sync
;(indexEngine as any).schemaObjectRepresentation_ = null
await (indexEngine as any).onApplicationStart_()
await setTimeout(3000)