@vladimirdev635/gql-codegen 0.0.108 → 0.0.109

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vladimirdev635/gql-codegen",
3
- "version": "0.0.108",
3
+ "version": "0.0.109",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "homepage": "https://github.com/Voldemat/graphql-plus-plus#readme",
package/schema/utils.d.ts CHANGED
@@ -1,15 +1,15 @@
1
1
  import { PathOrFileDescriptor } from 'fs';
2
- import { objectFieldSchema, objectFieldSpecSchema, objectSchema, ServerSchema, unionSchema } from './server.js';
3
- import { ClientSchema } from './client/root.js';
4
2
  import { z } from 'zod/v4';
5
- import { RootSchema } from './root.js';
6
- import { fieldSelection, fragmentSchema, fragmentSpecSchema } from './client/fragment.js';
7
3
  import { argument } from './client/argument.js';
4
+ import { fieldSelection, fragmentSchema, fragmentSpecSchema } from './client/fragment.js';
5
+ import { ClientSchema } from './client/root.js';
6
+ import { RootSchema } from './root.js';
7
+ import { objectFieldSchema, objectFieldSpecSchema, objectSchema, ServerSchema, unionSchema } from './server.js';
8
8
  export declare function loadSchemaFromFile<T extends z.ZodType>(p: PathOrFileDescriptor, schema: T): z.infer<T>;
9
9
  export declare function loadServerSchemaFromFile(p: PathOrFileDescriptor): ServerSchema;
10
10
  export declare function loadClientSchemaFromFile(p: PathOrFileDescriptor): ClientSchema;
11
- export declare function loadServerSchemaFromGQLSubprocess(gqlPath?: string, gqlArgs?: string[]): Promise<ServerSchema>;
12
- export declare function loadRootSchemaFromGQLSubprocess(gqlPath?: string, gqlArgs?: string[]): Promise<RootSchema>;
11
+ export declare function loadServerSchemaFromGQLSubprocess(gqlPath?: string, gqlArgs?: string[], maxBuffer?: number | undefined): Promise<ServerSchema>;
12
+ export declare function loadRootSchemaFromGQLSubprocess(gqlPath?: string, gqlArgs?: string[], maxBuffer?: number | undefined): Promise<RootSchema>;
13
13
  export declare function buildFragmentFromUnion(union: z.infer<typeof unionSchema>): z.infer<typeof fragmentSchema>;
14
14
  export declare function buildSelectionFromFieldSpec(spec: z.infer<typeof objectFieldSpecSchema>): z.infer<typeof fragmentSpecSchema> | null;
15
15
  export declare function buildArgumentFromFieldSpec(spec: z.infer<typeof objectFieldSpecSchema>): Record<string, z.infer<typeof argument>>;
package/schema/utils.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /* eslint-disable max-lines */
2
2
  import { readFileSync } from 'fs';
3
- import { serverSchema, } from './server.js';
4
- import { clientSchema } from './client/root.js';
5
3
  import { exec } from 'node:child_process';
4
+ import { clientSchema } from './client/root.js';
5
+ import { serverSchema, } from './server.js';
6
6
  export function loadSchemaFromFile(p, schema) {
7
7
  return schema.parse(JSON.parse(readFileSync(p).toString()));
8
8
  }
@@ -12,9 +12,11 @@ export function loadServerSchemaFromFile(p) {
12
12
  export function loadClientSchemaFromFile(p) {
13
13
  return loadSchemaFromFile(p, clientSchema);
14
14
  }
15
- export async function loadServerSchemaFromGQLSubprocess(gqlPath = 'gql', gqlArgs = ['generate']) {
15
+ export async function loadServerSchemaFromGQLSubprocess(gqlPath = 'gql', gqlArgs = ['generate'], maxBuffer = undefined) {
16
16
  const output = await new Promise((resolve, reject) => {
17
- exec([gqlPath, ...gqlArgs].join(' '), (err, stdout, stderr) => {
17
+ exec([gqlPath, ...gqlArgs].join(' '), {
18
+ maxBuffer,
19
+ }, (err, stdout, stderr) => {
18
20
  if (err !== null) {
19
21
  reject(err);
20
22
  }
@@ -26,9 +28,9 @@ export async function loadServerSchemaFromGQLSubprocess(gqlPath = 'gql', gqlArgs
26
28
  });
27
29
  return serverSchema.parse(JSON.parse(output));
28
30
  }
29
- export async function loadRootSchemaFromGQLSubprocess(gqlPath = 'gql', gqlArgs = ['generate']) {
31
+ export async function loadRootSchemaFromGQLSubprocess(gqlPath = 'gql', gqlArgs = ['generate'], maxBuffer = undefined) {
30
32
  const output = await new Promise((resolve, reject) => {
31
- exec([gqlPath, ...gqlArgs].join(' '), (err, stdout, stderr) => {
33
+ exec([gqlPath, ...gqlArgs].join(' '), { maxBuffer }, (err, stdout, stderr) => {
32
34
  if (err !== null) {
33
35
  reject(err);
34
36
  }