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.
Files changed (42) hide show
  1. package/build/cmd-cjs/index.js +484 -475
  2. package/build/cmd-esm/index.js +484 -475
  3. package/build/codegen/generators/artifacts/index.d.ts +2 -2
  4. package/build/codegen/generators/artifacts/indexFile.d.ts +2 -2
  5. package/build/codegen/generators/artifacts/selection.d.ts +2 -2
  6. package/build/codegen/generators/indexFile/index.d.ts +2 -2
  7. package/build/codegen/generators/persistedQueries/index.d.ts +2 -2
  8. package/build/codegen/generators/runtime/graphqlFunction.d.ts +2 -2
  9. package/build/codegen/generators/runtime/index.d.ts +2 -2
  10. package/build/codegen/generators/typescript/documentTypes.d.ts +2 -2
  11. package/build/codegen/generators/typescript/imperativeTypeDef.d.ts +2 -2
  12. package/build/codegen/generators/typescript/index.d.ts +2 -2
  13. package/build/codegen/index.d.ts +2 -2
  14. package/build/codegen/transforms/addID.d.ts +2 -2
  15. package/build/codegen/transforms/composeQueries.d.ts +4 -4
  16. package/build/codegen/transforms/fragmentVariables.d.ts +2 -2
  17. package/build/codegen/transforms/list.d.ts +2 -2
  18. package/build/codegen/transforms/paginate.d.ts +2 -2
  19. package/build/codegen/transforms/schema.d.ts +2 -2
  20. package/build/codegen/transforms/typename.d.ts +2 -2
  21. package/build/codegen/validators/noIDAlias.d.ts +2 -2
  22. package/build/codegen/validators/plugins.d.ts +2 -2
  23. package/build/codegen/validators/typeCheck.d.ts +2 -2
  24. package/build/codegen/validators/uniqueNames.d.ts +2 -2
  25. package/build/codegen-cjs/index.js +481 -472
  26. package/build/codegen-esm/index.js +481 -472
  27. package/build/lib/graphql.d.ts +2 -2
  28. package/build/lib/types.d.ts +35 -35
  29. package/build/lib-cjs/index.js +355 -355
  30. package/build/lib-esm/index.js +355 -355
  31. package/build/runtime/client/documentStore.d.ts +1 -1
  32. package/build/runtime/client/index.d.ts +7 -6
  33. package/build/runtime-cjs/client/documentStore.d.ts +1 -1
  34. package/build/runtime-cjs/client/index.d.ts +7 -6
  35. package/build/runtime-esm/client/documentStore.d.ts +1 -1
  36. package/build/runtime-esm/client/index.d.ts +7 -6
  37. package/build/test/index.d.ts +3 -3
  38. package/build/test-cjs/index.js +479 -470
  39. package/build/test-esm/index.js +479 -470
  40. package/build/vite-cjs/index.js +484 -475
  41. package/build/vite-esm/index.js +484 -475
  42. package/package.json +1 -1
@@ -1,9 +1,9 @@
1
1
  import * as graphql from 'graphql';
2
- import type { CollectedGraphQLDocument, Config } from '.';
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 | CollectedGraphQLDocument;
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;
@@ -17,7 +17,7 @@ export type TransformDocument = {
17
17
  /**
18
18
  * The result of collecting documents from source code
19
19
  */
20
- export type CollectedGraphQLDocument = {
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
- include_runtime?: string | {
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 include_runtime for this hook to matter.
100
+ * You must have passed a value to includeRuntime for this hook to matter.
101
101
  */
102
- transform_runtime?: Record<string, (args: {
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
- after_load?: (args: {
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
- extract_documents?: (args: {
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 artifact_data or artifact_selection to embed data in the artifact.
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
- before_validate?: (args: {
158
+ beforeValidate?: (args: {
159
159
  config: Config;
160
- documents: CollectedGraphQLDocument[];
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: CollectedGraphQLDocument[];
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
- after_validate?: (args: {
172
+ afterValidate?: (args: {
173
173
  config: Config;
174
- documents: CollectedGraphQLDocument[];
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
- transform_before_generate?: (args: {
179
+ beforeGenerate?: (args: {
180
180
  config: Config;
181
- documents: CollectedGraphQLDocument[];
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
- artifact_data?: (args: {
186
+ artifactData?: (args: {
187
187
  config: Config;
188
- document: CollectedGraphQLDocument;
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: CollectedGraphQLDocument;
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
- graphql_tag_return?: (args: {
201
+ graphqlTagReturn?: (args: {
202
202
  config: Config;
203
- document: CollectedGraphQLDocument;
204
- ensure_import: (import_args: {
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
- index_file?: ModuleIndexTransform;
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
- artifact_end?: (args: {
220
+ artifactEnd?: (args: {
221
221
  config: Config;
222
- document: CollectedGraphQLDocument;
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
- client_plugins?: Record<string, null | Record<string, any>> | ((config: ConfigFile, pluginConfig: any) => Record<string, null | Record<string, any>>);
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
- transform_file?: (page: TransformPage) => Promise<{
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
- export_default_as(args: {
253
+ exportDefaultAs(args: {
254
254
  module: string;
255
255
  as: string;
256
256
  }): string;
257
- export_star_from(args: {
257
+ exportStarFrom(args: {
258
258
  module: string;
259
259
  }): string;
260
- plugin_root: string;
260
+ pluginRoot: string;
261
261
  typedef: boolean;
262
- documents: CollectedGraphQLDocument[];
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: CollectedGraphQLDocument[];
268
- plugin_root: string;
267
+ documents: Document[];
268
+ pluginRoot: string;
269
269
  };
270
270
  export type PluginConfig = {
271
271
  configPath?: string;