43 lines
932 B
TypeScript
43 lines
932 B
TypeScript
import { defineJoinerConfig, Modules } from "@medusajs/framework/utils"
|
|
import {
|
|
Product,
|
|
ProductCategory,
|
|
ProductCollection,
|
|
ProductImage,
|
|
ProductOption,
|
|
ProductOptionValue,
|
|
ProductTag,
|
|
ProductType,
|
|
ProductVariant,
|
|
} from "@models"
|
|
import { default as schema } from "./schema"
|
|
|
|
export const joinerConfig = defineJoinerConfig(Modules.PRODUCT, {
|
|
schema,
|
|
models: [
|
|
Product,
|
|
ProductVariant,
|
|
ProductOption,
|
|
ProductOptionValue,
|
|
ProductType,
|
|
ProductTag,
|
|
ProductCollection,
|
|
ProductCategory,
|
|
ProductImage,
|
|
],
|
|
linkableKeys: {
|
|
// Merged with the autogenerated ones to maintain backward compatibility
|
|
variant_id: "ProductVariant",
|
|
},
|
|
primaryKeys: ["id", "handle"],
|
|
alias: [
|
|
{
|
|
name: ["product_variant", "product_variants", "variant", "variants"],
|
|
entity: "ProductVariant",
|
|
args: {
|
|
methodSuffix: "ProductVariants",
|
|
},
|
|
},
|
|
],
|
|
})
|