We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
{ "name": "medusa-starter-default", "version": "0.0.1", "description": "A starter for Medusa projects.", "author": "Medusa (https://medusajs.com)", "license": "MIT", "keywords": [ "sqlite", "postgres", "typescript", "ecommerce", "headless", "medusa" ], "scripts": { "build": "medusa build", "seed": "medusa exec ./src/scripts/seed.ts", "start": "medusa start", "dev": "medusa develop", "test:integration:http": "TEST_TYPE=integration:http NODE_OPTIONS=--experimental-vm-modules jest --silent=false --runInBand --forceExit", "test:integration:modules": "TEST_TYPE=integration:modules NODE_OPTIONS=--experimental-vm-modules jest --silent --runInBand --forceExit", "test:unit": "TEST_TYPE=unit NODE_OPTIONS=--experimental-vm-modules jest --silent --runInBand --forceExit" }, "dependencies": { "@mstore/comics": "workspace:*", "@medusajs/admin-sdk": "2.0.4", "@medusajs/cli": "2.0.4", "@medusajs/framework": "2.0.4", "@medusajs/medusa": "2.0.4", "@mikro-orm/core": "5.9.7", "@mikro-orm/knex": "5.9.7", "@mikro-orm/migrations": "5.9.7", "@mikro-orm/postgresql": "5.9.7", "awilix": "^8.0.1", "pg": "^8.13.0" }, "devDependencies": { "@medusajs/test-utils": "2.0.4", "@mikro-orm/cli": "5.9.7", "@swc/core": "1.5.7", "@swc/jest": "^0.2.36", "@types/jest": "^29.5.13", "@types/lodash": "^4.17.13", "@types/node": "^20.0.0", "@types/react": "^18.3.2", "@types/react-dom": "^18.2.25", "jest": "^29.7.0", "prop-types": "^15.8.1", "react": "^18.2.0", "react-dom": "^18.2.0", "ts-node": "^10.9.2", "typescript": "^5.6.2", "vite": "^5.2.11" }, "engines": { "node": ">=20" } }
v20.18.0
Postgres 16
MacOs
No response
Trying to query inventory items and their inventory levels using the following query
const inventoryQuery = remoteQueryObjectFromString({ entryPoint: "inventory_items", fields: ["*", "inventory_levels.*"], filters: { variants: { id: item.product_variant_id, }, }, })
Which results in the error:
error: Entity 'InventoryItem' does not have property 'inventory_levels'
Looking into the source code, it looks like the actual database field is location_levels
location_levels
medusa/packages/modules/inventory/src/models/inventory-item.ts
Line 122 in 7794faf
When I use this query
const inventoryQuery = remoteQueryObjectFromString({ entryPoint: "inventory_items", fields: ["*", "location_levels.*"], filters: { variants: { id: item.product_variant_id, }, }, })
I get a valid query but typescript yells at me (not sure where the types are defined for this)
I believe either the Model schema or Types should change to be in sync
InventoryItem.inventory_levels
InventoryItem.location_levels
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Package.json file
Node.js version
v20.18.0
Database and its version
Postgres 16
Operating system name and version
MacOs
Browser name
No response
What happended?
Trying to query inventory items and their inventory levels using the following query
Which results in the error:
Looking into the source code, it looks like the actual database field is
location_levels
medusa/packages/modules/inventory/src/models/inventory-item.ts
Line 122 in 7794faf
When I use this query
I get a valid query but typescript yells at me (not sure where the types are defined for this)
I believe either the Model schema or Types should change to be in sync
Expected behavior
InventoryItem.inventory_levels
Actual behavior
InventoryItem.location_levels
Link to reproduction repo
medusa/packages/modules/inventory/src/models/inventory-item.ts
Line 122 in 7794faf
The text was updated successfully, but these errors were encountered: