@graphql-codegen/plugin-helpers 2.4.1-alpha-bbecef04a.0 → 2.4.1-alpha-74513a63e.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/types.d.ts +6 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-codegen/plugin-helpers",
3
- "version": "2.4.1-alpha-bbecef04a.0",
3
+ "version": "2.4.1-alpha-74513a63e.0",
4
4
  "description": "GraphQL Code Generator common utils and types",
5
5
  "peerDependencies": {
6
6
  "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0"
package/types.d.ts CHANGED
@@ -19,6 +19,7 @@ export declare namespace Types {
19
19
  [key: string]: any;
20
20
  };
21
21
  profiler?: Profiler;
22
+ cache?<T>(namespace: string, key: string, factory: () => Promise<T>): Promise<T>;
22
23
  }
23
24
  type FileOutput = {
24
25
  filename: string;
@@ -28,7 +29,9 @@ export declare namespace Types {
28
29
  afterOneFileWrite?: LifecycleHooksDefinition['afterOneFileWrite'];
29
30
  };
30
31
  };
31
- type DocumentFile = Source;
32
+ interface DocumentFile extends Source {
33
+ hash?: string;
34
+ }
32
35
  type Promisable<T> = T | Promise<T>;
33
36
  type InstanceOrArray<T> = T | T[];
34
37
  /**
@@ -182,11 +185,7 @@ export declare namespace Types {
182
185
  interface CustomDocumentLoader {
183
186
  [path: string]: CustomDocumentLoaderOptions;
184
187
  }
185
- interface CustomDocumentRequire {
186
- require: string;
187
- config: object;
188
- }
189
- type OperationDocument = OperationDocumentGlobPath | CustomDocumentLoader | CustomDocumentRequire;
188
+ type OperationDocument = OperationDocumentGlobPath | CustomDocumentLoader;
190
189
  type PluginConfig<T = any> = {
191
190
  [key: string]: T;
192
191
  };
@@ -300,6 +299,7 @@ export declare namespace Types {
300
299
  [name: string]: any;
301
300
  };
302
301
  profiler?: Profiler;
302
+ cache?<T>(namespace: string, key: string, factory: () => Promise<T>): Promise<T>;
303
303
  };
304
304
  type OutputPreset<TPresetConfig = any> = {
305
305
  buildGeneratesSection: (options: PresetFnArgs<TPresetConfig>) => Promisable<GenerateOptions[]>;