feat(index): Provide a similar API to Query (#9193)
**What**
Align the index engine API to be similar to the Query API
## Example
```ts
// Benefit from the same level of typing like the remote query
const { data, metadata } = await indexEngine.query<'product'>({
fields: [
"product.*",
"product.variants.*",
"product.variants.prices.*",
],
filters: {
product: {
variants: {
prices: {
amount: { $gt: 50 },
},
},
},
},
pagination: {
order: {
product: {
variants: {
prices: {
amount: "DESC",
},
},
},
},
},
})
```
This commit is contained in:
1 parent
1215a7c094
commit
3084008fc9
40 files changed
+1145
-578
No files matched your search
@@ -64,6 +64,7 @@ async function start({ port, directory, types }) {
|
||||
const outputDirGeneratedTypes = path.join(directory, ".medusa")
|
||||
await gqlSchemaToTypes({
|
||||
outputDir: outputDirGeneratedTypes,
|
||||
filename: "remote-query-entry-points",
|
||||
schema: gqlSchema,
|
||||
})
|
||||
logger.info("Geneated modules types")
|
||||
|
||||
Reference in new issue
Block a user