chore: Register Query in container (#9103)

* chore(framework): Register the query

* chore(framework): Register the query
This commit is contained in:
Adrien de Peretti
2024-09-11 15:08:46 +02:00
committed by GitHub
parent a729fb3fbb
commit a01e7e4ffe
4 changed files with 130 additions and 51 deletions
+4 -2
View File
@@ -353,9 +353,11 @@ async function MedusaApp_({
)
if (loaderOnly) {
async function query(...args: Parameters<RemoteQueryFunction>) {
async function query(...args: any[]) {
throw new Error("Querying not allowed in loaderOnly mode")
}
query.graph = query
query.gql = query
return {
onApplicationShutdown,
@@ -363,7 +365,7 @@ async function MedusaApp_({
onApplicationStart,
modules: allModules,
link: undefined,
query: query as RemoteQueryFunction,
query: query as unknown as RemoteQueryFunction,
runMigrations: async () => {
throw new Error("Migrations not allowed in loaderOnly mode")
},