feat: Application types generation from project GQL schema's (#8995)
This commit is contained in:
@@ -31,7 +31,6 @@ export const POST = async (
|
||||
},
|
||||
fields: ["return_id"],
|
||||
}),
|
||||
undefined,
|
||||
{
|
||||
throwIfKeyNotFound: true,
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@ export const POST = async (
|
||||
},
|
||||
fields: ["return_id"],
|
||||
}),
|
||||
undefined,
|
||||
{
|
||||
throwIfKeyNotFound: true,
|
||||
}
|
||||
|
||||
@@ -30,7 +30,6 @@ export const POST = async (
|
||||
},
|
||||
fields: ["return_id"],
|
||||
}),
|
||||
undefined,
|
||||
{
|
||||
throwIfKeyNotFound: true,
|
||||
}
|
||||
@@ -79,7 +78,6 @@ export const DELETE = async (
|
||||
},
|
||||
fields: ["id", "return_id"],
|
||||
}),
|
||||
undefined,
|
||||
{
|
||||
throwIfKeyNotFound: true,
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@ export const POST = async (
|
||||
},
|
||||
fields: ["return_id"],
|
||||
}),
|
||||
undefined,
|
||||
{
|
||||
throwIfKeyNotFound: true,
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ export const POST = async (
|
||||
fields: req.remoteQueryConfig.fields,
|
||||
})
|
||||
|
||||
const [orderClaim] = await remoteQuery(queryObject, undefined, {
|
||||
const [orderClaim] = await remoteQuery(queryObject, {
|
||||
throwIfKeyNotFound: true,
|
||||
})
|
||||
|
||||
|
||||
@@ -31,7 +31,6 @@ export const POST = async (
|
||||
},
|
||||
fields: ["return_id"],
|
||||
}),
|
||||
undefined,
|
||||
{
|
||||
throwIfKeyNotFound: true,
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@ export const POST = async (
|
||||
},
|
||||
fields: ["return_id"],
|
||||
}),
|
||||
undefined,
|
||||
{
|
||||
throwIfKeyNotFound: true,
|
||||
}
|
||||
|
||||
-2
@@ -30,7 +30,6 @@ export const POST = async (
|
||||
},
|
||||
fields: ["return_id"],
|
||||
}),
|
||||
undefined,
|
||||
{
|
||||
throwIfKeyNotFound: true,
|
||||
}
|
||||
@@ -79,7 +78,6 @@ export const DELETE = async (
|
||||
},
|
||||
fields: ["return_id"],
|
||||
}),
|
||||
undefined,
|
||||
{
|
||||
throwIfKeyNotFound: true,
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@ export const POST = async (
|
||||
},
|
||||
fields: ["return_id"],
|
||||
}),
|
||||
undefined,
|
||||
{
|
||||
throwIfKeyNotFound: true,
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ export const POST = async (
|
||||
fields: req.remoteQueryConfig.fields,
|
||||
})
|
||||
|
||||
const [orderExchange] = await remoteQuery(queryObject, undefined, {
|
||||
const [orderExchange] = await remoteQuery(queryObject, {
|
||||
throwIfKeyNotFound: true,
|
||||
})
|
||||
|
||||
|
||||
@@ -140,7 +140,6 @@ export const refetchBatchProducts = async (
|
||||
fields: remapKeysForProduct(fields ?? []),
|
||||
})
|
||||
|
||||
// @ts-expect-error "Remote query can return null"
|
||||
created = remoteQuery(createdQuery)
|
||||
}
|
||||
|
||||
@@ -153,7 +152,6 @@ export const refetchBatchProducts = async (
|
||||
fields: remapKeysForProduct(fields ?? []),
|
||||
})
|
||||
|
||||
// @ts-expect-error "Remote query can return null"
|
||||
updated = remoteQuery(updatedQuery)
|
||||
}
|
||||
|
||||
@@ -187,7 +185,6 @@ export const refetchBatchVariants = async (
|
||||
fields: remapKeysForVariant(fields ?? []),
|
||||
})
|
||||
|
||||
// @ts-expect-error "Remote query can return null"
|
||||
created = remoteQuery(createdQuery)
|
||||
}
|
||||
|
||||
@@ -200,7 +197,6 @@ export const refetchBatchVariants = async (
|
||||
fields: remapKeysForVariant(fields ?? []),
|
||||
})
|
||||
|
||||
// @ts-expect-error "Remote query can return null"
|
||||
updated = remoteQuery(updatedQuery)
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,6 @@ export const refetchBatchRules = async (
|
||||
fields: fields,
|
||||
})
|
||||
|
||||
// @ts-expect-error "Remote query can return null"
|
||||
created = remoteQuery(createdQuery)
|
||||
}
|
||||
|
||||
@@ -55,7 +54,6 @@ export const refetchBatchRules = async (
|
||||
fields: fields,
|
||||
})
|
||||
|
||||
// @ts-expect-error "Remote query can return null"
|
||||
updated = remoteQuery(updatedQuery)
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ export const GET = async (
|
||||
fields: req.remoteQueryConfig.fields,
|
||||
})
|
||||
|
||||
const [orderReturn] = await remoteQuery(queryObject, undefined, {
|
||||
const [orderReturn] = await remoteQuery(queryObject, {
|
||||
throwIfKeyNotFound: true,
|
||||
})
|
||||
|
||||
|
||||
@@ -45,7 +45,6 @@ export const refetchBatchRules = async (
|
||||
fields: fields,
|
||||
})
|
||||
|
||||
// @ts-expect-error "Remote query can return null"
|
||||
created = remoteQuery(createdQuery)
|
||||
}
|
||||
|
||||
@@ -58,7 +57,6 @@ export const refetchBatchRules = async (
|
||||
fields: fields,
|
||||
})
|
||||
|
||||
// @ts-expect-error "Remote query can return null"
|
||||
updated = remoteQuery(updatedQuery)
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ export async function getVariantInventoryItems({
|
||||
"inventory.*",
|
||||
"inventory.location_levels.*",
|
||||
],
|
||||
})
|
||||
} as any)
|
||||
|
||||
const links = await remoteQuery(linkQuery)
|
||||
|
||||
|
||||
@@ -4,13 +4,14 @@ import {
|
||||
isString,
|
||||
remoteQueryObjectFromString,
|
||||
} from "@medusajs/utils"
|
||||
import { MedusaRequest } from "../../types/routing"
|
||||
|
||||
export const refetchEntities = async (
|
||||
entryPoint: string,
|
||||
idOrFilter: string | object,
|
||||
scope: MedusaContainer,
|
||||
fields: string[],
|
||||
pagination: object = {}
|
||||
pagination: MedusaRequest["remoteQueryConfig"]["pagination"] = {}
|
||||
) => {
|
||||
const remoteQuery = scope.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
|
||||
const filters = isString(idOrFilter) ? { id: idOrFilter } : idOrFilter
|
||||
|
||||
Reference in New Issue
Block a user