nitro-graphql 1.7.0-beta.1 → 1.7.0-beta.2

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,4 +1,4 @@
1
- import * as h35 from "h3";
1
+ import * as h37 from "h3";
2
2
 
3
3
  //#region src/routes/debug.d.ts
4
4
 
@@ -10,7 +10,7 @@ import * as h35 from "h3";
10
10
  * - /_nitro/graphql/debug - HTML dashboard
11
11
  * - /_nitro/graphql/debug?format=json - JSON API
12
12
  */
13
- declare const _default: h35.EventHandler<h35.EventHandlerRequest, Promise<string | {
13
+ declare const _default: h37.EventHandler<h37.EventHandlerRequest, Promise<string | {
14
14
  timestamp: string;
15
15
  environment: {
16
16
  dev: any;
@@ -1,6 +1,6 @@
1
- import * as h30 from "h3";
1
+ import * as h31 from "h3";
2
2
 
3
3
  //#region src/routes/graphql-yoga-ws.d.ts
4
- declare const _default: h30.EventHandler<h30.EventHandlerRequest, never>;
4
+ declare const _default: h31.EventHandler<h31.EventHandlerRequest, never>;
5
5
  //#endregion
6
6
  export { _default as default };
@@ -1,6 +1,6 @@
1
- import * as h37 from "h3";
1
+ import * as h30 from "h3";
2
2
 
3
3
  //#region src/routes/graphql-yoga.d.ts
4
- declare const _default: h37.EventHandler<h37.EventHandlerRequest, Promise<Response>>;
4
+ declare const _default: h30.EventHandler<h30.EventHandlerRequest, Promise<Response>>;
5
5
  //#endregion
6
6
  export { _default as default };
@@ -1,7 +1,7 @@
1
- import * as h31 from "h3";
1
+ import * as h35 from "h3";
2
2
 
3
3
  //#region src/routes/health.d.ts
4
- declare const _default: h31.EventHandler<h31.EventHandlerRequest, Promise<{
4
+ declare const _default: h35.EventHandler<h35.EventHandlerRequest, Promise<{
5
5
  status: string;
6
6
  message: string;
7
7
  timestamp: string;
@@ -39,7 +39,6 @@ declare function generateExternalClientTypes(service: ExternalGraphQLService, sc
39
39
  */
40
40
  interface SubscriptionInfo {
41
41
  name: string;
42
- methodName: string;
43
42
  fieldName: string;
44
43
  hasVariables: boolean;
45
44
  }
@@ -287,12 +287,6 @@ export function getSdk(requester: Requester): Sdk {
287
287
  async function generateExternalClientTypes(service, schema, docs, virtualTypesPath) {
288
288
  return generateClientTypes(schema, docs, service.codegen?.client || {}, service.codegen?.clientSDK || {}, void 0, service.name, virtualTypesPath, false);
289
289
  }
290
- /**
291
- * Convert PascalCase to camelCase
292
- */
293
- function toCamelCase(str) {
294
- return str.charAt(0).toLowerCase() + str.slice(1);
295
- }
296
290
  function extractSubscriptions(docs) {
297
291
  const subscriptions = [];
298
292
  for (const doc of docs) {
@@ -307,7 +301,6 @@ function extractSubscriptions(docs) {
307
301
  const hasVariables = (operationDef.variableDefinitions?.length || 0) > 0;
308
302
  subscriptions.push({
309
303
  name,
310
- methodName: toCamelCase(name),
311
304
  fieldName,
312
305
  hasVariables
313
306
  });
@@ -439,11 +432,11 @@ function createSubscriptionBuilder<TData>(query: string, variables: unknown): Su
439
432
 
440
433
  export const subscription = {
441
434
  `;
442
- for (const sub of subscriptions) if (sub.hasVariables) output += ` ${sub.methodName}(variables: Types.${sub.name}SubscriptionVariables): SubscriptionBuilder<Types.${sub.name}Subscription['${sub.fieldName}']> {
435
+ for (const sub of subscriptions) if (sub.hasVariables) output += ` ${sub.name}(variables: Types.${sub.name}SubscriptionVariables): SubscriptionBuilder<Types.${sub.name}Subscription['${sub.fieldName}']> {
443
436
  return createSubscriptionBuilder<Types.${sub.name}Subscription['${sub.fieldName}']>(${sub.name}Document, variables)
444
437
  },
445
438
  `;
446
- else output += ` ${sub.methodName}(): SubscriptionBuilder<Types.${sub.name}Subscription['${sub.fieldName}']> {
439
+ else output += ` ${sub.name}(): SubscriptionBuilder<Types.${sub.name}Subscription['${sub.fieldName}']> {
447
440
  return createSubscriptionBuilder<Types.${sub.name}Subscription['${sub.fieldName}']>(${sub.name}Document, undefined)
448
441
  },
449
442
  `;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nitro-graphql",
3
3
  "type": "module",
4
- "version": "1.7.0-beta.1",
4
+ "version": "1.7.0-beta.2",
5
5
  "description": "GraphQL integration for Nitro",
6
6
  "license": "MIT",
7
7
  "repository": {