@graphql-codegen/import-types-preset 2.2.3-alpha-0814e49cc.0 → 2.2.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 +5 -5
- package/typings/index.d.cts +47 -0
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-codegen/import-types-preset",
|
|
3
|
-
"version": "2.2.3
|
|
3
|
+
"version": "2.2.3",
|
|
4
4
|
"description": "GraphQL Code Generator preset for importing types to operation file",
|
|
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"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@graphql-codegen/add": "^3.2.1
|
|
10
|
-
"@graphql-codegen/plugin-helpers": "^2.6.
|
|
11
|
-
"@graphql-codegen/visitor-plugin-common": "2.12.1
|
|
9
|
+
"@graphql-codegen/add": "^3.2.1",
|
|
10
|
+
"@graphql-codegen/plugin-helpers": "^2.6.2",
|
|
11
|
+
"@graphql-codegen/visitor-plugin-common": "2.12.1",
|
|
12
12
|
"tslib": "~2.4.0"
|
|
13
13
|
},
|
|
14
14
|
"repository": {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"exports": {
|
|
28
28
|
".": {
|
|
29
29
|
"require": {
|
|
30
|
-
"types": "./typings/index.d.
|
|
30
|
+
"types": "./typings/index.d.cts",
|
|
31
31
|
"default": "./cjs/index.js"
|
|
32
32
|
},
|
|
33
33
|
"import": {
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Types } from '@graphql-codegen/plugin-helpers';
|
|
2
|
+
import { FragmentDefinitionNode } from 'graphql';
|
|
3
|
+
export declare type ImportTypesConfig = {
|
|
4
|
+
/**
|
|
5
|
+
* @description Required, should point to the base schema types file.
|
|
6
|
+
* The key of the output is used a the base path for this file.
|
|
7
|
+
*
|
|
8
|
+
* @exampleMarkdown
|
|
9
|
+
* ```yaml {5}
|
|
10
|
+
* generates:
|
|
11
|
+
* path/to/file.ts:
|
|
12
|
+
* preset: import-types
|
|
13
|
+
* presetConfig:
|
|
14
|
+
* typesPath: types.ts
|
|
15
|
+
* plugins:
|
|
16
|
+
* - typescript-operations
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
typesPath: string;
|
|
20
|
+
/**
|
|
21
|
+
* @description Optional, override the name of the import namespace used to import from the `baseTypesPath` file.
|
|
22
|
+
* @default Types
|
|
23
|
+
*
|
|
24
|
+
* @exampleMarkdown
|
|
25
|
+
* ```yaml {6}
|
|
26
|
+
* generates:
|
|
27
|
+
* src/:
|
|
28
|
+
* preset: import-types
|
|
29
|
+
* presetConfig:
|
|
30
|
+
* typesPath: types.ts
|
|
31
|
+
* importTypesNamespace: SchemaTypes
|
|
32
|
+
* plugins:
|
|
33
|
+
* - typescript-operations
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
importTypesNamespace?: string;
|
|
37
|
+
};
|
|
38
|
+
export declare type FragmentNameToFile = {
|
|
39
|
+
[fragmentName: string]: {
|
|
40
|
+
location: string;
|
|
41
|
+
importName: string;
|
|
42
|
+
onType: string;
|
|
43
|
+
node: FragmentDefinitionNode;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
export declare const preset: Types.OutputPreset<ImportTypesConfig>;
|
|
47
|
+
export default preset;
|