@constructive-io/graphql-codegen 2.29.0 → 2.30.0

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.
@@ -55,39 +55,9 @@ function generateOrmClientFile() {
55
55
  * DO NOT EDIT - changes will be overwritten
56
56
  */
57
57
 
58
- export interface GraphQLError {
59
- message: string;
60
- locations?: { line: number; column: number }[];
61
- path?: (string | number)[];
62
- extensions?: Record<string, unknown>;
63
- }
64
-
65
- /**
66
- * Discriminated union for query results
67
- * Use .ok to check success, or use .unwrap() to get data or throw
68
- */
69
- export type QueryResult<T> =
70
- | { ok: true; data: T; errors: undefined }
71
- | { ok: false; data: null; errors: GraphQLError[] };
58
+ import type { GraphQLAdapter, GraphQLError, QueryResult } from '@constructive-io/graphql-types';
72
59
 
73
- /**
74
- * Pluggable adapter interface for GraphQL execution.
75
- * Implement this interface to provide custom execution logic (e.g., for testing).
76
- */
77
- export interface GraphQLAdapter {
78
- /**
79
- * Execute a GraphQL operation and return the result.
80
- */
81
- execute<T>(document: string, variables?: Record<string, unknown>): Promise<QueryResult<T>>;
82
- /**
83
- * Set headers for requests (optional - only implement if adapter supports headers).
84
- */
85
- setHeaders?(headers: Record<string, string>): void;
86
- /**
87
- * Get the endpoint URL (optional - only implement if adapter has an endpoint).
88
- */
89
- getEndpoint?(): string;
90
- }
60
+ export type { GraphQLAdapter, GraphQLError, QueryResult } from '@constructive-io/graphql-types';
91
61
 
92
62
  /**
93
63
  * Default adapter that uses fetch for HTTP requests.
@@ -16,39 +16,9 @@ export function generateOrmClientFile() {
16
16
  * DO NOT EDIT - changes will be overwritten
17
17
  */
18
18
 
19
- export interface GraphQLError {
20
- message: string;
21
- locations?: { line: number; column: number }[];
22
- path?: (string | number)[];
23
- extensions?: Record<string, unknown>;
24
- }
25
-
26
- /**
27
- * Discriminated union for query results
28
- * Use .ok to check success, or use .unwrap() to get data or throw
29
- */
30
- export type QueryResult<T> =
31
- | { ok: true; data: T; errors: undefined }
32
- | { ok: false; data: null; errors: GraphQLError[] };
19
+ import type { GraphQLAdapter, GraphQLError, QueryResult } from '@constructive-io/graphql-types';
33
20
 
34
- /**
35
- * Pluggable adapter interface for GraphQL execution.
36
- * Implement this interface to provide custom execution logic (e.g., for testing).
37
- */
38
- export interface GraphQLAdapter {
39
- /**
40
- * Execute a GraphQL operation and return the result.
41
- */
42
- execute<T>(document: string, variables?: Record<string, unknown>): Promise<QueryResult<T>>;
43
- /**
44
- * Set headers for requests (optional - only implement if adapter supports headers).
45
- */
46
- setHeaders?(headers: Record<string, string>): void;
47
- /**
48
- * Get the endpoint URL (optional - only implement if adapter has an endpoint).
49
- */
50
- getEndpoint?(): string;
51
- }
21
+ export type { GraphQLAdapter, GraphQLError, QueryResult } from '@constructive-io/graphql-types';
52
22
 
53
23
  /**
54
24
  * Default adapter that uses fetch for HTTP requests.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@constructive-io/graphql-codegen",
3
- "version": "2.29.0",
3
+ "version": "2.30.0",
4
4
  "description": "CLI-based GraphQL SDK generator for PostGraphile endpoints with React Query hooks",
5
5
  "keywords": [
6
6
  "graphql",
@@ -55,6 +55,7 @@
55
55
  "dependencies": {
56
56
  "@babel/generator": "^7.28.6",
57
57
  "@babel/types": "^7.28.6",
58
+ "@constructive-io/graphql-types": "^2.14.0",
58
59
  "@inquirerer/utils": "^3.2.0",
59
60
  "ajv": "^8.17.1",
60
61
  "find-and-require-package-json": "^0.9.0",
@@ -89,5 +90,5 @@
89
90
  "tsx": "^4.21.0",
90
91
  "typescript": "^5.9.3"
91
92
  },
92
- "gitHead": "17c82525efb87a39529a02bf24c096bf75597fae"
93
+ "gitHead": "0f129a3a6f3e939d2c8c0597a9f3a689442b3dcc"
93
94
  }