chore(modules-sdk,orchestration): to remote joiner query (#4974)
Helper function to transform js/json object into RemoteJoinerQuery format.
```typescript
toRemoteJoinerQuery({
product: {
fields: ["id", "title"],
__args: {
skip: 0,
},
variants: {
fields: ["id", "title", "handle", "sku"],
shipping_profile: {
profile: {
fields: ["id", "name"],
},
},
},
collections: {
fields: ["id", "title"],
},
},
})
```
outputs:
```
{
alias: "product",
fields: ["id", "title"],
expands: [
{
property: "product.variants",
fields: ["id", "title", "handle", "sku"],
},
{
property: "product.variants.shipping_profile",
},
{
property: "product.variants.shipping_profile.profile",
fields: ["id", "name"],
},
{
property: "product.collections",
fields: ["id", "title"],
},
],
args: [
{
name: "skip",
value: 0,
},
],
};
```
This commit is contained in:
committed by
GitHub
parent
7a12aa04ac
commit
d8649bacaa
6
.changeset/bright-colts-rescue.md
Normal file
6
.changeset/bright-colts-rescue.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@medusajs/orchestration": minor
|
||||
"@medusajs/modules-sdk": minor
|
||||
---
|
||||
|
||||
object to remote joiner query
|
||||
Reference in New Issue
Block a user