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.
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { defineCommand, runMain } from 'citty';
3
3
 
4
- const version = "0.41.10";
4
+ const version = "0.41.11";
5
5
  const packageJson = {
6
6
  version: version};
7
7
 
@@ -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 silgiURL = !route.graphql ? getUrlPrefix(route.route || event.req.url, route.method) : {
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 || route.graphql ? {} : await parseRequestInput(event.req));
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 && !route.graphql) {
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 (!route.graphql) {
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: {
@@ -696,7 +696,6 @@ interface MetaData extends Record<string, unknown> {
696
696
  }
697
697
  interface SilgiRoute {
698
698
  route?: string;
699
- graphql?: boolean;
700
699
  method?: HTTPMethod | HTTPMethod[];
701
700
  service?: ResolvedServiceDefinition[string];
702
701
  middleware?: MiddlewareSetup;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "silgi",
3
3
  "type": "module",
4
- "version": "0.41.10",
4
+ "version": "0.41.11",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {