houdini 1.0.0-next.5 → 1.0.0-next.7
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/build/cmd-cjs/index.js +484 -475
- package/build/cmd-esm/index.js +484 -475
- package/build/codegen/generators/artifacts/index.d.ts +2 -2
- package/build/codegen/generators/artifacts/indexFile.d.ts +2 -2
- package/build/codegen/generators/artifacts/selection.d.ts +2 -2
- package/build/codegen/generators/indexFile/index.d.ts +2 -2
- package/build/codegen/generators/persistedQueries/index.d.ts +2 -2
- package/build/codegen/generators/runtime/graphqlFunction.d.ts +2 -2
- package/build/codegen/generators/runtime/index.d.ts +2 -2
- package/build/codegen/generators/typescript/documentTypes.d.ts +2 -2
- package/build/codegen/generators/typescript/imperativeTypeDef.d.ts +2 -2
- package/build/codegen/generators/typescript/index.d.ts +2 -2
- package/build/codegen/index.d.ts +2 -2
- package/build/codegen/transforms/addID.d.ts +2 -2
- package/build/codegen/transforms/composeQueries.d.ts +4 -4
- package/build/codegen/transforms/fragmentVariables.d.ts +2 -2
- package/build/codegen/transforms/list.d.ts +2 -2
- package/build/codegen/transforms/paginate.d.ts +2 -2
- package/build/codegen/transforms/schema.d.ts +2 -2
- package/build/codegen/transforms/typename.d.ts +2 -2
- package/build/codegen/validators/noIDAlias.d.ts +2 -2
- package/build/codegen/validators/plugins.d.ts +2 -2
- package/build/codegen/validators/typeCheck.d.ts +2 -2
- package/build/codegen/validators/uniqueNames.d.ts +2 -2
- package/build/codegen-cjs/index.js +481 -472
- package/build/codegen-esm/index.js +481 -472
- package/build/lib/graphql.d.ts +2 -2
- package/build/lib/types.d.ts +35 -35
- package/build/lib-cjs/index.js +355 -355
- package/build/lib-esm/index.js +355 -355
- package/build/runtime/client/documentStore.d.ts +1 -1
- package/build/runtime/client/index.d.ts +7 -6
- package/build/runtime-cjs/client/documentStore.d.ts +1 -1
- package/build/runtime-cjs/client/index.d.ts +7 -6
- package/build/runtime-esm/client/documentStore.d.ts +1 -1
- package/build/runtime-esm/client/index.d.ts +7 -6
- package/build/test/index.d.ts +3 -3
- package/build/test-cjs/index.js +479 -470
- package/build/test-esm/index.js +479 -470
- package/build/vite-cjs/index.js +484 -475
- package/build/vite-esm/index.js +484 -475
- package/package.json +1 -1
package/build/lib/graphql.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as graphql from 'graphql';
|
|
2
|
-
import type {
|
|
2
|
+
import type { Document, Config } from '.';
|
|
3
3
|
export declare function getRootType(type: graphql.GraphQLType): graphql.GraphQLType;
|
|
4
4
|
export declare function hashDocument({ document, }: {
|
|
5
5
|
config: Config;
|
|
6
|
-
document: string |
|
|
6
|
+
document: string | Document;
|
|
7
7
|
}): string;
|
|
8
8
|
type GraphQLParentType = graphql.GraphQLObjectType | graphql.GraphQLInputObjectType | graphql.GraphQLInterfaceType;
|
|
9
9
|
export declare function parentTypeFromAncestors(schema: graphql.GraphQLSchema, filepath: string, ancestors: readonly any[]): GraphQLParentType;
|
package/build/lib/types.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export type TransformDocument = {
|
|
|
17
17
|
/**
|
|
18
18
|
* The result of collecting documents from source code
|
|
19
19
|
*/
|
|
20
|
-
export type
|
|
20
|
+
export type Document = {
|
|
21
21
|
/**
|
|
22
22
|
* The name of the document.
|
|
23
23
|
*/
|
|
@@ -39,10 +39,6 @@ export type CollectedGraphQLDocument = {
|
|
|
39
39
|
* The parsed document. This value should be modified throughout the pipeline.
|
|
40
40
|
* */
|
|
41
41
|
document: graphql.DocumentNode;
|
|
42
|
-
/**
|
|
43
|
-
* The document that the user provided
|
|
44
|
-
* */
|
|
45
|
-
originalDocument: graphql.DocumentNode;
|
|
46
42
|
/**
|
|
47
43
|
* Whether an artifact should be generated for the document. This should be set to false for internal
|
|
48
44
|
* or virtual documents .
|
|
@@ -57,6 +53,10 @@ export type CollectedGraphQLDocument = {
|
|
|
57
53
|
* The original document string that the user passed
|
|
58
54
|
*/
|
|
59
55
|
originalString: string;
|
|
56
|
+
/**
|
|
57
|
+
* The parsed document that the user provided
|
|
58
|
+
* */
|
|
59
|
+
originalParsed: graphql.DocumentNode;
|
|
60
60
|
/**
|
|
61
61
|
* Refetch logic that has been built up throughout the pipeline
|
|
62
62
|
*/
|
|
@@ -91,15 +91,15 @@ export type PluginHooks = {
|
|
|
91
91
|
* A relative path from the file exporting your plugin to a runtime that will be
|
|
92
92
|
* automatically included with your
|
|
93
93
|
*/
|
|
94
|
-
|
|
94
|
+
includeRuntime?: string | {
|
|
95
95
|
esm: string;
|
|
96
96
|
commonjs: string;
|
|
97
97
|
};
|
|
98
98
|
/**
|
|
99
99
|
* Transform the plugin's runtime while houdini is copying it .
|
|
100
|
-
* You must have passed a value to
|
|
100
|
+
* You must have passed a value to includeRuntime for this hook to matter.
|
|
101
101
|
*/
|
|
102
|
-
|
|
102
|
+
transformRuntime?: Record<string, (args: {
|
|
103
103
|
config: Config;
|
|
104
104
|
content: string;
|
|
105
105
|
}) => string>;
|
|
@@ -119,7 +119,7 @@ export type PluginHooks = {
|
|
|
119
119
|
/**
|
|
120
120
|
* Invoked after all plugins have loaded and modified config values.
|
|
121
121
|
*/
|
|
122
|
-
|
|
122
|
+
afterLoad?: (args: {
|
|
123
123
|
config: Config;
|
|
124
124
|
}) => Promise<void> | void;
|
|
125
125
|
/**
|
|
@@ -139,7 +139,7 @@ export type PluginHooks = {
|
|
|
139
139
|
/**
|
|
140
140
|
* Configure the codegen pipeline to extract graphql documents out of a file.
|
|
141
141
|
*/
|
|
142
|
-
|
|
142
|
+
extractDocuments?: (args: {
|
|
143
143
|
config: Config;
|
|
144
144
|
filepath: string;
|
|
145
145
|
content: string;
|
|
@@ -147,7 +147,7 @@ export type PluginHooks = {
|
|
|
147
147
|
/**
|
|
148
148
|
* Can be used to add custom definitions to your project's schema. Definitions (like directives) added
|
|
149
149
|
* here are automatically removed from the document before they are sent to the server. Useful
|
|
150
|
-
* in connection with
|
|
150
|
+
* in connection with artifactData or artifact_selection to embed data in the artifact.
|
|
151
151
|
*/
|
|
152
152
|
schema?: (args: {
|
|
153
153
|
config: Config;
|
|
@@ -155,53 +155,53 @@ export type PluginHooks = {
|
|
|
155
155
|
/**
|
|
156
156
|
* A hook to transform the documents before they are validated.
|
|
157
157
|
*/
|
|
158
|
-
|
|
158
|
+
beforeValidate?: (args: {
|
|
159
159
|
config: Config;
|
|
160
|
-
documents:
|
|
160
|
+
documents: Document[];
|
|
161
161
|
}) => Promise<void> | void;
|
|
162
162
|
/**
|
|
163
163
|
* A hook to validate all of the documents in a project.
|
|
164
164
|
*/
|
|
165
165
|
validate?: (args: {
|
|
166
166
|
config: Config;
|
|
167
|
-
documents:
|
|
167
|
+
documents: Document[];
|
|
168
168
|
}) => Promise<void> | void;
|
|
169
169
|
/**
|
|
170
170
|
* A hook to transform the documents after they are validated.
|
|
171
171
|
*/
|
|
172
|
-
|
|
172
|
+
afterValidate?: (args: {
|
|
173
173
|
config: Config;
|
|
174
|
-
documents:
|
|
174
|
+
documents: Document[];
|
|
175
175
|
}) => Promise<void> | void;
|
|
176
176
|
/**
|
|
177
177
|
* A hook to transform the documents before documents are generated.
|
|
178
178
|
*/
|
|
179
|
-
|
|
179
|
+
beforeGenerate?: (args: {
|
|
180
180
|
config: Config;
|
|
181
|
-
documents:
|
|
181
|
+
documents: Document[];
|
|
182
182
|
}) => Promise<void> | void;
|
|
183
183
|
/**
|
|
184
184
|
* A hook to embed metadata at the root of the artifact.
|
|
185
185
|
*/
|
|
186
|
-
|
|
186
|
+
artifactData?: (args: {
|
|
187
187
|
config: Config;
|
|
188
|
-
document:
|
|
188
|
+
document: Document;
|
|
189
189
|
}) => Record<string, any>;
|
|
190
190
|
/**
|
|
191
191
|
* A hook to customize the hash generated for your document.
|
|
192
192
|
*/
|
|
193
193
|
hash?: (args: {
|
|
194
194
|
config: Config;
|
|
195
|
-
document:
|
|
195
|
+
document: Document;
|
|
196
196
|
}) => string;
|
|
197
197
|
/**
|
|
198
198
|
* A hook to customize the return type of the graphql function. If you need to add an import to the file
|
|
199
199
|
* in order to resolve the import, you can use the `ensure_import` utility.
|
|
200
200
|
*/
|
|
201
|
-
|
|
201
|
+
graphqlTagReturn?: (args: {
|
|
202
202
|
config: Config;
|
|
203
|
-
document:
|
|
204
|
-
|
|
203
|
+
document: Document;
|
|
204
|
+
ensureImport: (import_args: {
|
|
205
205
|
identifier: string;
|
|
206
206
|
module: string;
|
|
207
207
|
}) => void;
|
|
@@ -209,7 +209,7 @@ export type PluginHooks = {
|
|
|
209
209
|
/**
|
|
210
210
|
* A hook to modify the root `index.js` of the generated runtime.
|
|
211
211
|
*/
|
|
212
|
-
|
|
212
|
+
indexFile?: ModuleIndexTransform;
|
|
213
213
|
/**
|
|
214
214
|
* A hook to generate custom files for every document in a project.
|
|
215
215
|
*/
|
|
@@ -217,19 +217,19 @@ export type PluginHooks = {
|
|
|
217
217
|
/**
|
|
218
218
|
* A hook to modify the generated artifact before it is persisted
|
|
219
219
|
*/
|
|
220
|
-
|
|
220
|
+
artifactEnd?: (args: {
|
|
221
221
|
config: Config;
|
|
222
|
-
document:
|
|
222
|
+
document: Document;
|
|
223
223
|
}) => void;
|
|
224
224
|
/**
|
|
225
225
|
* Specify the plugins that should be added to the user's client because
|
|
226
226
|
* of this plugin.
|
|
227
227
|
*/
|
|
228
|
-
|
|
228
|
+
clientPlugins?: Record<string, null | Record<string, any>> | ((config: ConfigFile, pluginConfig: any) => Record<string, null | Record<string, any>>);
|
|
229
229
|
/**
|
|
230
230
|
* A hook to transform the source file to support desired APIs.
|
|
231
231
|
*/
|
|
232
|
-
|
|
232
|
+
transformFile?: (page: TransformPage) => Promise<{
|
|
233
233
|
code: string;
|
|
234
234
|
}> | {
|
|
235
235
|
code: string;
|
|
@@ -250,22 +250,22 @@ export type PluginHooks = {
|
|
|
250
250
|
type ModuleIndexTransform = (arg: {
|
|
251
251
|
config: Config;
|
|
252
252
|
content: string;
|
|
253
|
-
|
|
253
|
+
exportDefaultAs(args: {
|
|
254
254
|
module: string;
|
|
255
255
|
as: string;
|
|
256
256
|
}): string;
|
|
257
|
-
|
|
257
|
+
exportStarFrom(args: {
|
|
258
258
|
module: string;
|
|
259
259
|
}): string;
|
|
260
|
-
|
|
260
|
+
pluginRoot: string;
|
|
261
261
|
typedef: boolean;
|
|
262
|
-
documents:
|
|
262
|
+
documents: Document[];
|
|
263
263
|
}) => string;
|
|
264
264
|
export type GenerateHook = (args: GenerateHookInput) => Promise<void> | void;
|
|
265
265
|
export type GenerateHookInput = {
|
|
266
266
|
config: Config;
|
|
267
|
-
documents:
|
|
268
|
-
|
|
267
|
+
documents: Document[];
|
|
268
|
+
pluginRoot: string;
|
|
269
269
|
};
|
|
270
270
|
export type PluginConfig = {
|
|
271
271
|
configPath?: string;
|