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

@@ -1,8 +1,6 @@
import { defineJoinerConfig, Modules } from "@medusajs/framework/utils"
import { Price, PriceList, PricePreference, PriceSet } from "@models"
import { default as schema } from "./schema"
export const joinerConfig = defineJoinerConfig(Modules.PRICING, {
schema,
models: [PriceSet, PriceList, Price, PricePreference],
})

View File

@@ -1,59 +0,0 @@
export const schema = `
type PriceSet {
id: ID!
prices: [Price]
calculated_price: CalculatedPriceSet
}
type Price {
id: ID!
currency_code: String
amount: Float
min_quantity: Float
max_quantity: Float
rules_count: Int
price_rules: [PriceRule]
created_at: DateTime
updated_at: DateTime
deleted_at: DateTime
}
type PriceRule {
id: ID!
price_set_id: String!
price_set: PriceSet
attribute: String!
value: String!
priority: Int!
price_id: String!
price_list_id: String!
created_at: DateTime
updated_at: DateTime
deleted_at: DateTime
}
type CalculatedPriceSet {
id: ID!
is_calculated_price_price_list: Boolean
is_calculated_price_tax_inclusive: Boolean
calculated_amount: Float
raw_calculated_amount: JSON
is_original_price_price_list: Boolean
is_original_price_tax_inclusive: Boolean
original_amount: Float
raw_original_amount: JSON
currency_code: String
calculated_price: PriceDetails
original_price: PriceDetails
}
type PriceDetails {
id: ID
price_list_id: String
price_list_type: String
min_quantity: Float
max_quantity: Float
}
`
export default schema