@schema-hub/zod-graphql-client 0.0.1 → 0.0.3

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,9 +1,9 @@
1
1
  {
2
2
  "author": "Mathias Schreck <schreck.mathias@gmail.com>",
3
3
  "dependencies": {
4
- "@schema-hub/zod-error-formatter": "0.0.5",
5
- "@schema-hub/zod-graphql-query-builder": "0.0.2",
6
- "ky": "1.2.3"
4
+ "@schema-hub/zod-error-formatter": "0.0.6",
5
+ "@schema-hub/zod-graphql-query-builder": "0.0.4",
6
+ "ky": "1.4.0"
7
7
  },
8
8
  "description": "A lightweight and type-safe zod-based GraphQL client",
9
9
  "engines": {
@@ -21,7 +21,7 @@
21
21
  "main": "zod-graphql-client/entry-point.js",
22
22
  "name": "@schema-hub/zod-graphql-client",
23
23
  "peerDependencies": {
24
- "zod": "3.22.4"
24
+ "zod": "^3.22.4"
25
25
  },
26
26
  "repository": {
27
27
  "type": "git",
@@ -29,5 +29,5 @@
29
29
  },
30
30
  "type": "module",
31
31
  "types": "zod-graphql-client/entry-point.d.ts",
32
- "version": "0.0.1"
32
+ "version": "0.0.3"
33
33
  }
package/readme.md CHANGED
@@ -81,7 +81,7 @@ const schema = z
81
81
  // Send the query using the client
82
82
  const client = createGraphqlClient({ endpoint: 'https://example.com/graphql' });
83
83
  const result = await client.query(schema, {
84
- queryName: 'YourQueryName', // Optional query name
84
+ operationName: 'YourQueryName', // Optional query name
85
85
  variables: {
86
86
  bar: {
87
87
  type: 'String!',
@@ -93,72 +93,96 @@ const result = await client.query(schema, {
93
93
  console.log(result);
94
94
  ```
95
95
 
96
- #### Options
96
+ ### Sending a Mutation
97
97
 
98
- - `queryName` (optional): The name of the query. This is useful for debugging and introspection purposes.
99
- - `variables` (optional): A record of all variable values and types that should be included in the query. This allows you to parameterize your queries and provide dynamic values at runtime.
100
- - `headers` (optional): A key-value map of additional headers that should be sent with the request. These headers will be merged with any headers specified when creating the client.
101
- - `timeout` (optional): The request timeout in milliseconds. This determines how long the client will wait for a response before considering the request failed. If not specified, the default timeout specified when creating the client will be used.
98
+ ```typescript
99
+ import { createGraphqlClient, graphqlFieldOptions, variablePlaceholder } from '@schema-hub/zod-graphql-client';
100
+ import { z } from 'zod';
101
+
102
+ // Define your mutation schema using Zod
103
+ const schema = z
104
+ .object({
105
+ // Provide graphql-specific metadata to your zod schema
106
+ foo: graphqlFieldOptions(z.string(), {
107
+ parameters: {
108
+ bar: variablePlaceholder('$bar')
109
+ }
110
+ })
111
+ })
112
+ .strict();
113
+
114
+ // Send the mutation using the client
115
+ const client = createGraphqlClient({ endpoint: 'https://example.com/graphql' });
116
+ const result = await client.mutate(schema, {
117
+ operationName: 'YourMutationName', // Optional mutation name
118
+ variables: {
119
+ bar: {
120
+ type: 'String!',
121
+ value: 'the-actual-value-for-bar'
122
+ }
123
+ }
124
+ });
102
125
 
103
- Adjust these options according to your specific requirements and the needs of your GraphQL API.
126
+ console.log(result);
127
+ ```
104
128
 
105
- Adding a section to elaborate on the return value of the `query()` method would be beneficial under the "Sending a Query" section. This would provide users with a clear understanding of what to expect when making a query and how to handle the response.
129
+ ### Options for Queries and Mutations
106
130
 
107
- Here's a suggestion for the content of this section:
131
+ - `operationName` (optional): The name of the query or mutation. This is useful for debugging and introspection purposes.
132
+ - `variables` (optional): A record of all variable values and types that should be included in the query or mutation. This allows you to parameterize your operations and provide dynamic values at runtime.
133
+ - `headers` (optional): A key-value map of additional headers that should be sent with the request. These headers will be merged with any headers specified when creating the client.
134
+ - `timeout` (optional): The request timeout in milliseconds. This determines how long the client will wait for a response before considering the request failed. If not specified, the default timeout specified when creating the client will be used.
108
135
 
109
- ### Query Result
136
+ ### Operation Result
110
137
 
111
- When you send a query using the `query()` method of the GraphQL client, you receive a `QueryResult` object representing the outcome of the query. This object contains information about whether the query was successful and, if so, the data returned by the GraphQL server.
138
+ When you send a query or mutation using the `query()` or `mutate()` method of the GraphQL client, you receive an `OperationResult` object representing the outcome of the operation. This object contains information about whether the operation was successful and, if so, the data returned by the GraphQL server.
112
139
 
113
- The `QueryResult` object has the following structure:
140
+ The `OperationResult` object has the following structure:
114
141
 
115
142
  ```typescript
116
- type FailureQueryResult = {
143
+ type FailureOperationResult = {
117
144
  success: false;
118
- errorDetails: QueryErrorDetails;
145
+ errorDetails: OperationErrorDetails;
119
146
  };
120
147
 
121
- type SuccessQueryResult<Schema extends QuerySchema> = {
148
+ type SuccessOperationResult<Schema extends OperationSchema> = {
122
149
  success: true;
123
150
  data: z.infer<Schema>;
124
151
  };
125
152
 
126
- type QueryResult<Schema extends QuerySchema> = FailureQueryResult | SuccessQueryResult<Schema>;
153
+ type OperationResult<Schema extends OperationSchema> = FailureOperationResult | SuccessOperationResult<Schema>;
127
154
  ```
128
155
 
129
- - If the query was successful, the `success` property will be `true`, and the `data` property will contain the response data, inferred based on the provided Zod schema.
156
+ - If the operation was successful, the `success` property will be `true`, and the `data` property will contain the response data, inferred based on the provided Zod schema.
157
+ - If the operation failed, the `success` property will be `false`, and the `errorDetails` property will contain information about the error encountered during the operation. This includes details such as the error type, status code (if applicable), and error message.
130
158
 
131
- - If the query failed, the `success` property will be `false`, and the `errorDetails` property will contain information about the error encountered during the query. This includes details such as the error type, status code (if applicable), and error message.
132
-
133
- Here's how you can handle the query result:
159
+ Here's how you can handle the operation result:
134
160
 
135
161
  ```typescript
136
162
  const result = await client.query(schema, options);
137
163
 
138
164
  if (result.success) {
139
- // Query was successful, handle the response data
165
+ // Operation was successful, handle the response data
140
166
  console.log(result.data);
141
167
  } else {
142
- // Query failed, handle the error
143
- console.error('Query failed:', result.errorDetails);
168
+ // Operation failed, handle the error
169
+ console.error('Operation failed:', result.errorDetails);
144
170
  }
145
171
  ```
146
172
 
147
- Certainly! Here's the updated explanation along with the modifications to the error types section:
148
-
149
- #### Error Types
173
+ ### Error Types
150
174
 
151
- Errors distinguishable based on the `type` property within the `errorDetails` object. The possible error types are:
175
+ Errors are distinguishable based on the `type` property within the `errorDetails` object. The possible error types are:
152
176
 
153
177
  - **`network`**: Occurs when there are issues with the network connection, such as timeouts or unexpected network problems.
154
178
  - **`server`**: Indicates an error response from the server, typically due to unexpected status codes like `500`.
155
179
  - **`graphql`**: Indicates errors in the GraphQL response, such as invalid query syntax or execution errors on the server.
156
- - **`validation`**: Occurs when the data in the query response does not match the given `zod` schema, indicating a validation failure.
180
+ - **`validation`**: Occurs when the data in the operation response does not match the given `zod` schema, indicating a validation failure.
157
181
  - **`unknown`**: Represents any other unexpected errors that do not fall into the above categories.
158
182
 
159
- #### `queryOrThrow()`
183
+ ### `queryOrThrow()` and `mutateOrThrow()`
160
184
 
161
- The `queryOrThrow()` function behaves similarly to `query()`, but with one key difference in its return type. If the query execution is successful, the function returns the query result data directly. However, if an error occurs during the query execution, it throws an instance of `GraphqlQueryError`. This custom error contains detailed information about the encountered error in its `details` property, which aligns with the `errorDetails` structure returned by the `query()` function.
185
+ The `queryOrThrow()` and `mutateOrThrow()` functions behaves similarly to `query()` and `mutate()`, but with one key difference in its return type. If the operation execution is successful, the function returns the operation result data directly. However, if an error occurs during the operation execution, it throws an instance of `GraphqlOperationError`. This custom error contains detailed information about the encountered error in its `details` property, which aligns with the `errorDetails` structure returned by the `operation()` function.
162
186
 
163
187
  ### Re-exported Functions
164
188
 
@@ -172,9 +196,9 @@ For more details, see the [`@schema-hub/zod-graphql-query-builder` documentation
172
196
 
173
197
  ### Testing
174
198
 
175
- If you're writing tests for your code, consider using the `@schema-hub/zod-graphql-fake-client` package for testing. It provides a fake GraphQL client that can be used in place of the real client. This allows you to control the behavior of the client and inspect the queries sent without making actual network requests.
199
+ If you're writing tests for your code, consider using the `@schema-hub/zod-graphql-fake-client` package for testing. It provides a fake GraphQL client that can be used in place of the real client. This allows control over the client behavior and inspection of the queries and mutations sent without making actual network requests.
176
200
 
177
- Here's a quick example of how you can use it:
201
+ Here's a quick example of how to use it:
178
202
 
179
203
  ```typescript
180
204
  import { createFakeGraphqlClient } from '@schema-hub/zod-graphql-fake-client';
@@ -183,4 +207,4 @@ import { createFakeGraphqlClient } from '@schema-hub/zod-graphql-fake-client';
183
207
  const client = createFakeGraphqlClient();
184
208
  ```
185
209
 
186
- Replace the real client with the fake client in your test environment to isolate your tests and ensure predictable behavior.
210
+ Replace the real client with the fake client in the test environment to isolate tests and ensure predictable behavior.
@@ -1,10 +1,10 @@
1
1
  import { type KyInstance } from 'ky';
2
2
  import type { TypeOf } from 'zod';
3
3
  import { type QuerySchema } from '@schema-hub/zod-graphql-query-builder/zod-graphql-query-builder/entry-point.d.ts';
4
- import type { QueryResult } from './query-result.js';
4
+ import type { OperationResult } from './operation-result.js';
5
5
  import { type Variables } from './variables.js';
6
- export type QueryOptions = {
7
- queryName?: string;
6
+ export type OperationOptions = {
7
+ operationName?: string;
8
8
  timeout?: number;
9
9
  headers?: Record<string, string | undefined>;
10
10
  variables?: Variables;
@@ -15,13 +15,20 @@ export type ClientOptions = {
15
15
  timeout?: number;
16
16
  };
17
17
  export type GraphqlClient = {
18
- readonly query: <Schema extends QuerySchema>(schema: Schema, options?: QueryOptions) => Promise<QueryResult<Schema>>;
19
- readonly queryOrThrow: <Schema extends QuerySchema>(schema: Schema, options?: QueryOptions) => Promise<TypeOf<Schema>>;
18
+ readonly query: <Schema extends QuerySchema>(schema: Schema, options?: OperationOptions) => Promise<OperationResult<Schema>>;
19
+ readonly queryOrThrow: <Schema extends QuerySchema>(schema: Schema, options?: OperationOptions) => Promise<TypeOf<Schema>>;
20
+ readonly mutate: <Schema extends QuerySchema>(schema: Schema, options?: OperationOptions) => Promise<OperationResult<Schema>>;
21
+ readonly mutateOrThrow: <Schema extends QuerySchema>(schema: Schema, options?: OperationOptions) => Promise<TypeOf<Schema>>;
20
22
  };
21
23
  type CreateClientFn = (clientOptions: ClientOptions) => GraphqlClient;
22
24
  export type CreateClientDependencies = {
23
25
  ky: KyInstance;
24
26
  };
27
+ export type GraphqlOverHttpOperationRequestPayload = {
28
+ query: string;
29
+ variables: Record<string, unknown>;
30
+ operationName?: string | undefined;
31
+ };
25
32
  export declare function createClientFactory(dependencies: CreateClientDependencies): CreateClientFn;
26
33
  export {};
27
34
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../source/zod-graphql-client/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAkD,MAAM,IAAI,CAAC;AACrF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAElC,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAGlG,OAAO,KAAK,EAAsB,WAAW,EAAsB,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EAAqD,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEnG,MAAM,MAAM,YAAY,GAAG;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IAC7C,SAAS,CAAC,EAAE,SAAS,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IACxB,QAAQ,CAAC,KAAK,EAAE,CAAC,MAAM,SAAS,WAAW,EACvC,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,YAAY,KACrB,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;IAClC,QAAQ,CAAC,YAAY,EAAE,CAAC,MAAM,SAAS,WAAW,EAC9C,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,YA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eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;IACtC,QAAQ,CAAC,YAAY,EAAE,CAAC,MAAM,SAAS,WAAW,EAC9C,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,gBAAgB,KACzB,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,CAAC,MAAM,SAAS,WAAW,EACxC,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,gBAAgB,KACzB,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;IACtC,QAAQ,CAAC,aAAa,EAAE,CAAC,MAAM,SAAS,WAAW,EAC/C,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,gBAAgB,KACzB,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;CAChC,CAAC;AAEF,KAAK,cAAc,GAAG,CAAC,aAAa,EAAE,aAAa,KAAK,aAAa,CAAC;AAEtE,MAAM,MAAM,wBAAwB,GAAG;IACnC,EAAE,EAAE,UAAU,CAAC;CAClB,CAAC;AAiCF,MAAM,MAAM,sCAAsC,GAAG;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,wBAAwB,GAAG,cAAc,CA2K1F"}
@@ -1,8 +1,8 @@
1
1
  import { TimeoutError } from 'ky';
2
2
  import { safeParse } from '@schema-hub/zod-error-formatter/zod-error-formatter/formatter.js';
3
- import { buildGraphqlQuery } from '@schema-hub/zod-graphql-query-builder/zod-graphql-query-builder/entry-point.js';
3
+ import { buildGraphqlMutation, buildGraphqlQuery } from '@schema-hub/zod-graphql-query-builder/zod-graphql-query-builder/entry-point.js';
4
4
  import { parseGraphqlResponse } from './graphql-response.js';
5
- import { GraphqlQueryError } from './query-error.js';
5
+ import { GraphqlOperationError } from './operation-error.js';
6
6
  import { extractVariableDefinitions, extractVariableValues } from './variables.js';
7
7
  const defaultRequestTimeout = 10_000;
8
8
  const successResponseStatusCode = 200;
@@ -36,30 +36,35 @@ function mapUnknownNetworkErrorToFailureResult(error, timeout) {
36
36
  export function createClientFactory(dependencies) {
37
37
  const { ky } = dependencies;
38
38
  return function createClient(clientOptions) {
39
- function buildBaseRequestOptions(queryOptions) {
40
- const timeout = queryOptions.timeout ?? clientOptions.timeout ?? defaultRequestTimeout;
39
+ function buildBaseRequestOptions(operationOptions) {
40
+ const timeout = operationOptions.timeout ?? clientOptions.timeout ?? defaultRequestTimeout;
41
41
  return {
42
42
  headers: {
43
43
  ...clientOptions.headers,
44
- ...queryOptions.headers
44
+ ...operationOptions.headers
45
45
  },
46
46
  timeout,
47
47
  throwHttpErrors: false,
48
48
  retry: 0
49
49
  };
50
50
  }
51
- function prepareRequestPayload(schema, options) {
51
+ function prepareRequestPayload(schema, operationType, options) {
52
52
  const { variables = {} } = options;
53
53
  const variableDefinitions = extractVariableDefinitions(variables);
54
54
  const variableValues = extractVariableValues(variables);
55
- const serializedQuery = buildGraphqlQuery(schema, {
56
- queryName: options.queryName,
57
- variableDefinitions
58
- });
55
+ const serializedQuery = operationType === 'query'
56
+ ? buildGraphqlQuery(schema, {
57
+ operationName: options.operationName,
58
+ variableDefinitions
59
+ })
60
+ : buildGraphqlMutation(schema, {
61
+ operationName: options.operationName,
62
+ variableDefinitions
63
+ });
59
64
  return {
60
65
  query: serializedQuery,
61
66
  variables: variableValues,
62
- operationName: options.queryName
67
+ operationName: options.operationName
63
68
  };
64
69
  }
65
70
  async function parseServerResponse(response) {
@@ -122,8 +127,8 @@ export function createClientFactory(dependencies) {
122
127
  return mapUnknownNetworkErrorToFailureResult(error, baseRequestOptions.timeout);
123
128
  }
124
129
  }
125
- async function query(schema, options = {}) {
126
- const payload = prepareRequestPayload(schema, options);
130
+ async function performOperation(schema, operationType, options = {}) {
131
+ const payload = prepareRequestPayload(schema, operationType, options);
127
132
  const serverResponseParseResult = await fetchGraphqlEndpoint(options, payload);
128
133
  if (serverResponseParseResult.success) {
129
134
  const graphqlResponseParseResult = parseGraphqlResponse(serverResponseParseResult.data);
@@ -134,6 +139,12 @@ export function createClientFactory(dependencies) {
134
139
  }
135
140
  return serverResponseParseResult;
136
141
  }
142
+ async function query(schema, options = {}) {
143
+ return performOperation(schema, 'query', options);
144
+ }
145
+ async function mutate(schema, options = {}) {
146
+ return performOperation(schema, 'mutation', options);
147
+ }
137
148
  return {
138
149
  query,
139
150
  async queryOrThrow(schema, options) {
@@ -141,7 +152,15 @@ export function createClientFactory(dependencies) {
141
152
  if (result.success) {
142
153
  return result.data;
143
154
  }
144
- throw new GraphqlQueryError(result.errorDetails);
155
+ throw new GraphqlOperationError(result.errorDetails);
156
+ },
157
+ mutate,
158
+ async mutateOrThrow(schema, options) {
159
+ const result = await mutate(schema, options);
160
+ if (result.success) {
161
+ return result.data;
162
+ }
163
+ throw new GraphqlOperationError(result.errorDetails);
145
164
  }
146
165
  };
147
166
  };
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../source/zod-graphql-client/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqD,YAAY,EAAE,MAAM,IAAI,CAAC;AAErF,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAoB,MAAM,6CAA6C,CAAC;AAClG,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAE,0BAA0B,EAAE,qBAAqB,EAAkB,MAAM,gBAAgB,CAAC;AAgCnG,MAAM,qBAAqB,GAAG,MAAM,CAAC;AACrC,MAAM,yBAAyB,GAAG,GAAG,CAAC;AAEtC,SAAS,qCAAqC,CAAC,KAAc,EA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AAE,UAAU,EAAE,OAAO,CAAC,CAAC;QACzD,CAAC;QAED,OAAO;YACH,KAAK;YAEL,KAAK,CAAC,YAAY,CAAC,MAAM,EAAE,OAAO;gBAC9B,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;gBAC5C,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;oBACjB,OAAO,MAAM,CAAC,IAAI,CAAC;gBACvB,CAAC;gBAED,MAAM,IAAI,qBAAqB,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;YACzD,CAAC;YAED,MAAM;YAEN,KAAK,CAAC,aAAa,CAAC,MAAM,EAAE,OAAO;gBAC/B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;gBAC7C,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;oBACjB,OAAO,MAAM,CAAC,IAAI,CAAC;gBACvB,CAAC;gBAED,MAAM,IAAI,qBAAqB,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;YACzD,CAAC;SACJ,CAAC;IACN,CAAC,CAAC;AACN,CAAC"}
@@ -6,8 +6,8 @@ export type GraphqlClientOptions = ClientOptions & {
6
6
  export declare function createGraphqlClient(clientOptions: GraphqlClientOptions): GraphqlClient;
7
7
  export type { QuerySchema } from '@schema-hub/zod-graphql-query-builder/zod-graphql-query-builder/entry-point.d.ts';
8
8
  export { enumValue, graphqlFieldOptions, variablePlaceholder } from '@schema-hub/zod-graphql-query-builder/zod-graphql-query-builder/entry-point.d.ts';
9
- export type { GraphqlClient } from './client.js';
10
- export type { QueryErrorDetails } from './query-error.js';
11
- export { GraphqlQueryError } from './query-error.js';
12
- export type { QueryResult } from './query-result.js';
9
+ export type { GraphqlClient, GraphqlOverHttpOperationRequestPayload } from './client.js';
10
+ export type { OperationErrorDetails } from './operation-error.js';
11
+ export { GraphqlOperationError } from './operation-error.js';
12
+ export type { OperationResult } from './operation-result.js';
13
13
  //# sourceMappingURL=entry-point.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"entry-point.d.ts","sourceRoot":"","sources":["../../../../source/zod-graphql-client/entry-point.ts"],"names":[],"mappings":"AAAA,OAAe,EAAE,KAAK,OAAO,IAAI,SAAS,EAAE,MAAM,IAAI,CAAC;AACvD,OAAO,EAAE,KAAK,aAAa,EAAuB,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAE1F,MAAM,MAAM,oBAAoB,GAAG,aAAa,GAAG;IAC/C,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;CACvC,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,aAAa,EAAE,oBAAoB,GAAG,aAAa,CAMtF;AAED,YAAY,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AAClH,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,YAAY,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"entry-point.d.ts","sourceRoot":"","sources":["../../../../source/zod-graphql-client/entry-point.ts"],"names":[],"mappings":"AAAA,OAAe,EAAE,KAAK,OAAO,IAAI,SAAS,EAAE,MAAM,IAAI,CAAC;AACvD,OAAO,EAAE,KAAK,aAAa,EAAuB,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAE1F,MAAM,MAAM,oBAAoB,GAAG,aAAa,GAAG;IAC/C,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;CACvC,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,aAAa,EAAE,oBAAoB,GAAG,aAAa,CAMtF;AAED,YAAY,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AAClH,YAAY,EAAE,aAAa,EAAE,sCAAsC,EAAE,MAAM,aAAa,CAAC;AACzF,YAAY,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,YAAY,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC"}
@@ -7,5 +7,5 @@ export function createGraphqlClient(clientOptions) {
7
7
  return createClient(remainingOptions);
8
8
  }
9
9
  export { enumValue, graphqlFieldOptions, variablePlaceholder } from '@schema-hub/zod-graphql-query-builder/zod-graphql-query-builder/entry-point.js';
10
- export { GraphqlQueryError } from './query-error.js';
10
+ export { GraphqlOperationError } from './operation-error.js';
11
11
  //# sourceMappingURL=entry-point.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"entry-point.js","sourceRoot":"","sources":["../../../../source/zod-graphql-client/entry-point.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAA6B,MAAM,IAAI,CAAC;AACvD,OAAO,EAAsB,mBAAmB,EAAsB,MAAM,aAAa,CAAC;AAM1F,MAAM,UAAU,mBAAmB,CAAC,aAAmC;IACnE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,gBAAgB,EAAE,GAAG,aAAa,CAAC;IAC9D,MAAM,EAAE,GAAG,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;IAE9E,MAAM,YAAY,GAAG,mBAAmB,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IACjD,OAAO,YAAY,CAAC,gBAAgB,CAAC,CAAC;AAC1C,CAAC;AAGD,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AAGlH,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"entry-point.js","sourceRoot":"","sources":["../../../../source/zod-graphql-client/entry-point.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAA6B,MAAM,IAAI,CAAC;AACvD,OAAO,EAAsB,mBAAmB,EAAsB,MAAM,aAAa,CAAC;AAM1F,MAAM,UAAU,mBAAmB,CAAC,aAAmC;IACnE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,gBAAgB,EAAE,GAAG,aAAa,CAAC;IAC9D,MAAM,EAAE,GAAG,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;IAE9E,MAAM,YAAY,GAAG,mBAAmB,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IACjD,OAAO,YAAY,CAAC,gBAAgB,CAAC,CAAC;AAC1C,CAAC;AAGD,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AAGlH,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC"}
@@ -20,11 +20,10 @@ type NetworkError = BaseError & {
20
20
  type UnknownError = BaseError & {
21
21
  type: 'unknown';
22
22
  };
23
- export type QueryErrorDetails = GraphqlResponseError | NetworkError | ServerError | UnknownError | ValidationError;
24
- export type QueryErrorType = QueryErrorDetails['type'];
25
- export declare class GraphqlQueryError extends Error {
26
- readonly details: Omit<QueryErrorDetails, 'message'>;
27
- constructor(details: QueryErrorDetails);
23
+ export type OperationErrorDetails = GraphqlResponseError | NetworkError | ServerError | UnknownError | ValidationError;
24
+ export declare class GraphqlOperationError extends Error {
25
+ readonly details: Omit<OperationErrorDetails, 'message'>;
26
+ constructor(details: OperationErrorDetails);
28
27
  }
29
28
  export {};
30
- //# sourceMappingURL=query-error.d.ts.map
29
+ //# sourceMappingURL=operation-error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operation-error.d.ts","sourceRoot":"","sources":["../../../../source/zod-graphql-client/operation-error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAEjE,KAAK,SAAS,GAAG;IACb,OAAO,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,KAAK,oBAAoB,GAAG,SAAS,GAAG;IACpC,IAAI,EAAE,SAAS,CAAC;IAChB,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CACjC,CAAC;AAEF,KAAK,WAAW,GAAG,SAAS,GAAG;IAC3B,IAAI,EAAE,QAAQ,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,KAAK,eAAe,GAAG,SAAS,GAAG;IAC/B,IAAI,EAAE,YAAY,CAAC;IACnB,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CACjC,CAAC;AAEF,KAAK,YAAY,GAAG,SAAS,GAAG;IAC5B,IAAI,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF,KAAK,YAAY,GAAG,SAAS,GAAG;IAC5B,IAAI,EAAE,SAAS,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,oBAAoB,GAAG,YAAY,GAAG,WAAW,GAAG,YAAY,GAAG,eAAe,CAAC;AAEvH,qBAAa,qBAAsB,SAAQ,KAAK;IAE5C,SAAgB,OAAO,EAAE,IAAI,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC;gBAEpD,OAAO,EAAE,qBAAqB;CAM7C"}
@@ -1,4 +1,4 @@
1
- export class GraphqlQueryError extends Error {
1
+ export class GraphqlOperationError extends Error {
2
2
  // eslint-disable-next-line @typescript-eslint/ban-types -- no type-fest installed
3
3
  details;
4
4
  constructor(details) {
@@ -8,4 +8,4 @@ export class GraphqlQueryError extends Error {
8
8
  this.details = remainingDetails;
9
9
  }
10
10
  }
11
- //# sourceMappingURL=query-error.js.map
11
+ //# sourceMappingURL=operation-error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operation-error.js","sourceRoot":"","sources":["../../../../source/zod-graphql-client/operation-error.ts"],"names":[],"mappings":"AA+BA,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IAC5C,kFAAkF;IAClE,OAAO,CAAyC;IAEhE,YAAY,OAA8B;QACtC,MAAM,EAAE,OAAO,EAAE,GAAG,gBAAgB,EAAE,GAAG,OAAO,CAAC;QACjD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,uFAAuF;QACvF,IAAI,CAAC,OAAO,GAAG,gBAAgB,CAAC;IACpC,CAAC;CACJ"}
@@ -0,0 +1,17 @@
1
+ import type { TypeOf } from 'zod';
2
+ import type { QuerySchema } from '@schema-hub/zod-graphql-query-builder/zod-graphql-query-builder/entry-point.d.ts';
3
+ import type { OperationErrorDetails } from './operation-error.js';
4
+ export type OperationFailureResult = {
5
+ data?: undefined;
6
+ success: false;
7
+ errorDetails: OperationErrorDetails;
8
+ };
9
+ type OperationSuccessResult<Data> = {
10
+ errorDetails?: undefined;
11
+ success: true;
12
+ data: Data;
13
+ };
14
+ export type OperationResultForType<Data> = OperationFailureResult | OperationSuccessResult<Data>;
15
+ export type OperationResult<Schema extends QuerySchema> = OperationResultForType<TypeOf<Schema>>;
16
+ export {};
17
+ //# sourceMappingURL=operation-result.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operation-result.d.ts","sourceRoot":"","sources":["../../../../source/zod-graphql-client/operation-result.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAClC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAC/E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAElE,MAAM,MAAM,sBAAsB,GAA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AG,oBAAoB,GAAG,YAAY,GAAG,WAAW,GAAG,YAAY,GAAG,eAAe,CAAC;AACnH,MAAM,MAAM,cAAc,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;AAEvD,qBAAa,iBAAkB,SAAQ,KAAK;IAExC,SAAgB,OAAO,EAAE,IAAI,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAC;gBAEhD,OAAO,EAAE,iBAAiB;CAMzC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"query-error.js","sourceRoot":"","sources":["../../../../source/zod-graphql-client/query-error.ts"],"names":[],"mappings":"AAgCA,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IACxC,kFAAkF;IAClE,OAAO,CAAqC;IAE5D,YAAY,OAA0B;QAClC,MAAM,EAAE,OAAO,EAAE,GAAG,gBAAgB,EAAE,GAAG,OAAO,CAAC;QACjD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,uFAAuF;QACvF,IAAI,CAAC,OAAO,GAAG,gBAAgB,CAAC;IACpC,CAAC;CACJ"}
@@ -1,17 +0,0 @@
1
- import type { TypeOf } from 'zod';
2
- import type { QuerySchema } from '@schema-hub/zod-graphql-query-builder/zod-graphql-query-builder/entry-point.d.ts';
3
- import type { QueryErrorDetails } from './query-error.js';
4
- export type FailureQueryResult = {
5
- data?: undefined;
6
- success: false;
7
- errorDetails: QueryErrorDetails;
8
- };
9
- type SuccessQueryResult<Data> = {
10
- errorDetails?: undefined;
11
- success: true;
12
- data: Data;
13
- };
14
- export type QueryResultForType<Data> = FailureQueryResult | SuccessQueryResult<Data>;
15
- export type QueryResult<Schema extends QuerySchema> = QueryResultForType<TypeOf<Schema>>;
16
- export {};
17
- //# sourceMappingURL=query-result.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"query-result.d.ts","sourceRoot":"","sources":["../../../../source/zod-graphql-client/query-result.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAClC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAC/E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,MAAM,MAAM,kBAAkB,GAAG;IAC7B,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,OAAO,EAAE,KAAK,CAAC;IACf,YAAY,EAAE,iBAAiB,CAAC;CACnC,CAAC;AAEF,KAAK,kBAAkB,CAAC,IAAI,IAAI;IAC5B,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,OAAO,EAAE,IAAI,CAAC;IACd,IAAI,EAAE,IAAI,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,kBAAkB,CAAC,IAAI,IAAI,kBAAkB,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;AAErF,MAAM,MAAM,WAAW,CAAC,MAAM,SAAS,WAAW,IAAI,kBAAkB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC"}