silgi 0.40.0 → 0.40.1
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.d.mts +5 -4
- package/dist/core/index.mjs +4 -4
- package/package.json +1 -1
package/dist/cli/index.mjs
CHANGED
package/dist/core/index.d.mts
CHANGED
|
@@ -19,12 +19,13 @@ declare function silgiFetch(_request: Request | URL, options?: RequestInit & {
|
|
|
19
19
|
pathParams?: Record<string, any>;
|
|
20
20
|
}, context?: SilgiRuntimeContext): Promise<Response | Promise<Response>>;
|
|
21
21
|
declare function middleware(event: SilgiEvent, url?: {
|
|
22
|
-
path
|
|
23
|
-
method
|
|
22
|
+
path?: string;
|
|
23
|
+
method?: string;
|
|
24
24
|
}): Promise<any>;
|
|
25
25
|
declare function handler(event: SilgiEvent, url?: {
|
|
26
|
-
path
|
|
27
|
-
method
|
|
26
|
+
path?: string;
|
|
27
|
+
method?: string;
|
|
28
|
+
graphql?: boolean;
|
|
28
29
|
}, input?: any): Promise<any>;
|
|
29
30
|
|
|
30
31
|
/**
|
package/dist/core/index.mjs
CHANGED
|
@@ -590,10 +590,10 @@ function getUrlPrefix(path, method) {
|
|
|
590
590
|
};
|
|
591
591
|
}
|
|
592
592
|
|
|
593
|
-
async function orchestrate(route, event, _input) {
|
|
593
|
+
async function orchestrate(route, event, _input, graphql) {
|
|
594
594
|
const silgiCtx = useSilgi();
|
|
595
595
|
const silgiURL = getUrlPrefix(route.route || event.req.url, route.method);
|
|
596
|
-
const input = _input || (route.service?.rules?.readBeforeBody === false ? {} : await parseRequestInput(event.req));
|
|
596
|
+
const input = _input || (route.service?.rules?.readBeforeBody === false || graphql ? {} : await parseRequestInput(event.req));
|
|
597
597
|
const hookContext = { earlyReturnValue: false };
|
|
598
598
|
const routerParams = _input ? input.path : getRouterParams(event);
|
|
599
599
|
const queryParams = _input ? input.query : getQuery(event);
|
|
@@ -1001,12 +1001,12 @@ async function handler(event, url, input) {
|
|
|
1001
1001
|
}
|
|
1002
1002
|
event.context.params = match.params;
|
|
1003
1003
|
event.context.matchedRoute = match.data;
|
|
1004
|
-
return orchestrate(match.data, event, input);
|
|
1004
|
+
return orchestrate(match.data, event, input, url?.graphql);
|
|
1005
1005
|
});
|
|
1006
1006
|
} else {
|
|
1007
1007
|
event.context.params = match.params;
|
|
1008
1008
|
event.context.matchedRoute = match.data;
|
|
1009
|
-
return orchestrate(match.data, event, input);
|
|
1009
|
+
return orchestrate(match.data, event, input, url?.graphql);
|
|
1010
1010
|
}
|
|
1011
1011
|
}
|
|
1012
1012
|
}
|