silgi 0.41.10 → 0.41.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.mjs +1 -1
- package/dist/core/index.mjs +5 -5
- package/dist/types/index.d.mts +0 -1
- package/package.json +1 -1
package/dist/cli/index.mjs
CHANGED
package/dist/core/index.mjs
CHANGED
|
@@ -586,7 +586,8 @@ function getUrlPrefix(path, method) {
|
|
|
586
586
|
|
|
587
587
|
async function orchestrate(route, event, _input) {
|
|
588
588
|
const silgiCtx = useSilgi();
|
|
589
|
-
const
|
|
589
|
+
const isGraphQL = route.method === "GRAPHQL";
|
|
590
|
+
const silgiURL = !isGraphQL ? getUrlPrefix(route.route || event.req.url, route.method) : {
|
|
590
591
|
methodName: route.method || "GET",
|
|
591
592
|
namespaceName: "graphql",
|
|
592
593
|
prefixName: "/api",
|
|
@@ -595,7 +596,7 @@ async function orchestrate(route, event, _input) {
|
|
|
595
596
|
pathParams: {},
|
|
596
597
|
queryParams: {}
|
|
597
598
|
};
|
|
598
|
-
const input = _input || (route.service?.setup.rules?.readBeforeBody === false ||
|
|
599
|
+
const input = _input || (route.service?.setup.rules?.readBeforeBody === false || isGraphQL ? {} : await parseRequestInput(event.req));
|
|
599
600
|
const hookContext = { earlyReturnValue: false };
|
|
600
601
|
const routerParams = _input ? input.path : getRouterParams(event);
|
|
601
602
|
const queryParams = _input ? input.query : getQuery(event);
|
|
@@ -613,7 +614,7 @@ async function orchestrate(route, event, _input) {
|
|
|
613
614
|
}
|
|
614
615
|
};
|
|
615
616
|
try {
|
|
616
|
-
if (!route.service &&
|
|
617
|
+
if (!route.service && route.method !== "GRAPHQL") {
|
|
617
618
|
throw createError({
|
|
618
619
|
statusCode: 404,
|
|
619
620
|
statusMessage: "Service not found"
|
|
@@ -649,7 +650,7 @@ async function orchestrate(route, event, _input) {
|
|
|
649
650
|
silgiCtx.shared.$fetch = silgiFetch;
|
|
650
651
|
silgiCtx.shared.silgi = silgiCtx;
|
|
651
652
|
let result;
|
|
652
|
-
if (!
|
|
653
|
+
if (!isGraphQL) {
|
|
653
654
|
result = await route.service?.setup.handler?.(
|
|
654
655
|
inputData,
|
|
655
656
|
silgiCtx.shared,
|
|
@@ -1011,7 +1012,6 @@ async function handler(event, url, input) {
|
|
|
1011
1012
|
if (!match && url?.method === "GRAPHQL") {
|
|
1012
1013
|
match = {
|
|
1013
1014
|
data: {
|
|
1014
|
-
graphql: true,
|
|
1015
1015
|
method: url?.method || event.req.method,
|
|
1016
1016
|
route: url?.path,
|
|
1017
1017
|
service: {
|
package/dist/types/index.d.mts
CHANGED