@graphql-codegen/typescript-mongodb 2.4.4 → 2.4.5-alpha-20221018122157-1afce2555
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 +3 -3
- package/typings/config.d.cts +90 -23
- package/typings/config.d.ts +90 -23
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-codegen/typescript-mongodb",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.5-alpha-20221018122157-1afce2555",
|
|
4
4
|
"description": "GraphQL Code Generator plugin for generting a ready-to-use ORM types for MongoDB",
|
|
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",
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@graphql-codegen/plugin-helpers": "^2.6.2",
|
|
11
|
-
"@graphql-codegen/typescript": "
|
|
12
|
-
"@graphql-codegen/visitor-plugin-common": "2.
|
|
11
|
+
"@graphql-codegen/typescript": "2.7.5-alpha-20221018122157-1afce2555",
|
|
12
|
+
"@graphql-codegen/visitor-plugin-common": "2.13.0-alpha-20221018122157-1afce2555",
|
|
13
13
|
"@graphql-tools/utils": "^8.8.0",
|
|
14
14
|
"auto-bind": "~4.0.0",
|
|
15
15
|
"lodash": "~4.17.0",
|
package/typings/config.d.cts
CHANGED
|
@@ -5,9 +5,21 @@ export interface TypeScriptMongoPluginConfig extends RawConfig {
|
|
|
5
5
|
* @description Customize the suffix for the generated GraphQL `type`s.
|
|
6
6
|
*
|
|
7
7
|
* @exampleMarkdown
|
|
8
|
-
* ```
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* ```ts filename="codegen.ts"
|
|
9
|
+
* import type { CodegenConfig } from '@graphql-codegen/cli';
|
|
10
|
+
*
|
|
11
|
+
* const config: CodegenConfig = {
|
|
12
|
+
* // ...
|
|
13
|
+
* generates: {
|
|
14
|
+
* 'path/to/file.ts': {
|
|
15
|
+
* // plugins...
|
|
16
|
+
* config: {
|
|
17
|
+
* dbTypeSuffix: 'MyType'
|
|
18
|
+
* },
|
|
19
|
+
* },
|
|
20
|
+
* },
|
|
21
|
+
* };
|
|
22
|
+
* export default config;
|
|
11
23
|
* ```
|
|
12
24
|
*/
|
|
13
25
|
dbTypeSuffix?: string;
|
|
@@ -16,9 +28,21 @@ export interface TypeScriptMongoPluginConfig extends RawConfig {
|
|
|
16
28
|
* @description Customize the suffix for the generated GraphQL `interface`s.
|
|
17
29
|
*
|
|
18
30
|
* @exampleMarkdown
|
|
19
|
-
* ```
|
|
20
|
-
*
|
|
21
|
-
*
|
|
31
|
+
* ```ts filename="codegen.ts"
|
|
32
|
+
* import type { CodegenConfig } from '@graphql-codegen/cli';
|
|
33
|
+
*
|
|
34
|
+
* const config: CodegenConfig = {
|
|
35
|
+
* // ...
|
|
36
|
+
* generates: {
|
|
37
|
+
* 'path/to/file.ts': {
|
|
38
|
+
* // plugins...
|
|
39
|
+
* config: {
|
|
40
|
+
* dbInterfaceSuffix: 'MyInterface'
|
|
41
|
+
* },
|
|
42
|
+
* },
|
|
43
|
+
* },
|
|
44
|
+
* };
|
|
45
|
+
* export default config;
|
|
22
46
|
* ```
|
|
23
47
|
*/
|
|
24
48
|
dbInterfaceSuffix?: string;
|
|
@@ -27,9 +51,21 @@ export interface TypeScriptMongoPluginConfig extends RawConfig {
|
|
|
27
51
|
* @description Customize the type of `_id` fields. You can either specify a type name, or specify `module#type`.
|
|
28
52
|
*
|
|
29
53
|
* @exampleMarkdown
|
|
30
|
-
* ```
|
|
31
|
-
*
|
|
32
|
-
*
|
|
54
|
+
* ```ts filename="codegen.ts"
|
|
55
|
+
* import type { CodegenConfig } from '@graphql-codegen/cli';
|
|
56
|
+
*
|
|
57
|
+
* const config: CodegenConfig = {
|
|
58
|
+
* // ...
|
|
59
|
+
* generates: {
|
|
60
|
+
* 'path/to/file.ts': {
|
|
61
|
+
* // plugins...
|
|
62
|
+
* config: {
|
|
63
|
+
* objectIdType: './my-models.ts#MyIdType'
|
|
64
|
+
* },
|
|
65
|
+
* },
|
|
66
|
+
* },
|
|
67
|
+
* };
|
|
68
|
+
* export default config;
|
|
33
69
|
* ```
|
|
34
70
|
*/
|
|
35
71
|
objectIdType?: string;
|
|
@@ -38,9 +74,21 @@ export interface TypeScriptMongoPluginConfig extends RawConfig {
|
|
|
38
74
|
* @description Customize the name of the id field generated after using `@id` directive over a GraphQL field.
|
|
39
75
|
*
|
|
40
76
|
* @exampleMarkdown
|
|
41
|
-
* ```
|
|
42
|
-
*
|
|
43
|
-
*
|
|
77
|
+
* ```ts filename="codegen.ts"
|
|
78
|
+
* import type { CodegenConfig } from '@graphql-codegen/cli';
|
|
79
|
+
*
|
|
80
|
+
* const config: CodegenConfig = {
|
|
81
|
+
* // ...
|
|
82
|
+
* generates: {
|
|
83
|
+
* 'path/to/file.ts': {
|
|
84
|
+
* // plugins...
|
|
85
|
+
* config: {
|
|
86
|
+
* idFieldName: 'id'
|
|
87
|
+
* },
|
|
88
|
+
* },
|
|
89
|
+
* },
|
|
90
|
+
* };
|
|
91
|
+
* export default config;
|
|
44
92
|
* ```
|
|
45
93
|
*/
|
|
46
94
|
idFieldName?: string;
|
|
@@ -49,9 +97,21 @@ export interface TypeScriptMongoPluginConfig extends RawConfig {
|
|
|
49
97
|
* @description Replaces generated `enum` values with `string`.
|
|
50
98
|
*
|
|
51
99
|
* @exampleMarkdown
|
|
52
|
-
* ```
|
|
53
|
-
*
|
|
54
|
-
*
|
|
100
|
+
* ```ts filename="codegen.ts"
|
|
101
|
+
* import type { CodegenConfig } from '@graphql-codegen/cli';
|
|
102
|
+
*
|
|
103
|
+
* const config: CodegenConfig = {
|
|
104
|
+
* // ...
|
|
105
|
+
* generates: {
|
|
106
|
+
* 'path/to/file.ts': {
|
|
107
|
+
* // plugins...
|
|
108
|
+
* config: {
|
|
109
|
+
* enumsAsString: false
|
|
110
|
+
* },
|
|
111
|
+
* },
|
|
112
|
+
* },
|
|
113
|
+
* };
|
|
114
|
+
* export default config;
|
|
55
115
|
* ```
|
|
56
116
|
*/
|
|
57
117
|
enumsAsString?: boolean;
|
|
@@ -62,14 +122,21 @@ export interface TypeScriptMongoPluginConfig extends RawConfig {
|
|
|
62
122
|
* @default false
|
|
63
123
|
*
|
|
64
124
|
* @exampleMarkdown
|
|
65
|
-
* ```
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
125
|
+
* ```ts filename="codegen.ts"
|
|
126
|
+
* import type { CodegenConfig } from '@graphql-codegen/cli';
|
|
127
|
+
*
|
|
128
|
+
* const config: CodegenConfig = {
|
|
129
|
+
* // ...
|
|
130
|
+
* generates: {
|
|
131
|
+
* 'path/to/file.ts': {
|
|
132
|
+
* // plugins...
|
|
133
|
+
* config: {
|
|
134
|
+
* avoidOptionals: true
|
|
135
|
+
* },
|
|
136
|
+
* },
|
|
137
|
+
* },
|
|
138
|
+
* };
|
|
139
|
+
* export default config;
|
|
73
140
|
* ```
|
|
74
141
|
*/
|
|
75
142
|
avoidOptionals?: boolean;
|
package/typings/config.d.ts
CHANGED
|
@@ -5,9 +5,21 @@ export interface TypeScriptMongoPluginConfig extends RawConfig {
|
|
|
5
5
|
* @description Customize the suffix for the generated GraphQL `type`s.
|
|
6
6
|
*
|
|
7
7
|
* @exampleMarkdown
|
|
8
|
-
* ```
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* ```ts filename="codegen.ts"
|
|
9
|
+
* import type { CodegenConfig } from '@graphql-codegen/cli';
|
|
10
|
+
*
|
|
11
|
+
* const config: CodegenConfig = {
|
|
12
|
+
* // ...
|
|
13
|
+
* generates: {
|
|
14
|
+
* 'path/to/file.ts': {
|
|
15
|
+
* // plugins...
|
|
16
|
+
* config: {
|
|
17
|
+
* dbTypeSuffix: 'MyType'
|
|
18
|
+
* },
|
|
19
|
+
* },
|
|
20
|
+
* },
|
|
21
|
+
* };
|
|
22
|
+
* export default config;
|
|
11
23
|
* ```
|
|
12
24
|
*/
|
|
13
25
|
dbTypeSuffix?: string;
|
|
@@ -16,9 +28,21 @@ export interface TypeScriptMongoPluginConfig extends RawConfig {
|
|
|
16
28
|
* @description Customize the suffix for the generated GraphQL `interface`s.
|
|
17
29
|
*
|
|
18
30
|
* @exampleMarkdown
|
|
19
|
-
* ```
|
|
20
|
-
*
|
|
21
|
-
*
|
|
31
|
+
* ```ts filename="codegen.ts"
|
|
32
|
+
* import type { CodegenConfig } from '@graphql-codegen/cli';
|
|
33
|
+
*
|
|
34
|
+
* const config: CodegenConfig = {
|
|
35
|
+
* // ...
|
|
36
|
+
* generates: {
|
|
37
|
+
* 'path/to/file.ts': {
|
|
38
|
+
* // plugins...
|
|
39
|
+
* config: {
|
|
40
|
+
* dbInterfaceSuffix: 'MyInterface'
|
|
41
|
+
* },
|
|
42
|
+
* },
|
|
43
|
+
* },
|
|
44
|
+
* };
|
|
45
|
+
* export default config;
|
|
22
46
|
* ```
|
|
23
47
|
*/
|
|
24
48
|
dbInterfaceSuffix?: string;
|
|
@@ -27,9 +51,21 @@ export interface TypeScriptMongoPluginConfig extends RawConfig {
|
|
|
27
51
|
* @description Customize the type of `_id` fields. You can either specify a type name, or specify `module#type`.
|
|
28
52
|
*
|
|
29
53
|
* @exampleMarkdown
|
|
30
|
-
* ```
|
|
31
|
-
*
|
|
32
|
-
*
|
|
54
|
+
* ```ts filename="codegen.ts"
|
|
55
|
+
* import type { CodegenConfig } from '@graphql-codegen/cli';
|
|
56
|
+
*
|
|
57
|
+
* const config: CodegenConfig = {
|
|
58
|
+
* // ...
|
|
59
|
+
* generates: {
|
|
60
|
+
* 'path/to/file.ts': {
|
|
61
|
+
* // plugins...
|
|
62
|
+
* config: {
|
|
63
|
+
* objectIdType: './my-models.ts#MyIdType'
|
|
64
|
+
* },
|
|
65
|
+
* },
|
|
66
|
+
* },
|
|
67
|
+
* };
|
|
68
|
+
* export default config;
|
|
33
69
|
* ```
|
|
34
70
|
*/
|
|
35
71
|
objectIdType?: string;
|
|
@@ -38,9 +74,21 @@ export interface TypeScriptMongoPluginConfig extends RawConfig {
|
|
|
38
74
|
* @description Customize the name of the id field generated after using `@id` directive over a GraphQL field.
|
|
39
75
|
*
|
|
40
76
|
* @exampleMarkdown
|
|
41
|
-
* ```
|
|
42
|
-
*
|
|
43
|
-
*
|
|
77
|
+
* ```ts filename="codegen.ts"
|
|
78
|
+
* import type { CodegenConfig } from '@graphql-codegen/cli';
|
|
79
|
+
*
|
|
80
|
+
* const config: CodegenConfig = {
|
|
81
|
+
* // ...
|
|
82
|
+
* generates: {
|
|
83
|
+
* 'path/to/file.ts': {
|
|
84
|
+
* // plugins...
|
|
85
|
+
* config: {
|
|
86
|
+
* idFieldName: 'id'
|
|
87
|
+
* },
|
|
88
|
+
* },
|
|
89
|
+
* },
|
|
90
|
+
* };
|
|
91
|
+
* export default config;
|
|
44
92
|
* ```
|
|
45
93
|
*/
|
|
46
94
|
idFieldName?: string;
|
|
@@ -49,9 +97,21 @@ export interface TypeScriptMongoPluginConfig extends RawConfig {
|
|
|
49
97
|
* @description Replaces generated `enum` values with `string`.
|
|
50
98
|
*
|
|
51
99
|
* @exampleMarkdown
|
|
52
|
-
* ```
|
|
53
|
-
*
|
|
54
|
-
*
|
|
100
|
+
* ```ts filename="codegen.ts"
|
|
101
|
+
* import type { CodegenConfig } from '@graphql-codegen/cli';
|
|
102
|
+
*
|
|
103
|
+
* const config: CodegenConfig = {
|
|
104
|
+
* // ...
|
|
105
|
+
* generates: {
|
|
106
|
+
* 'path/to/file.ts': {
|
|
107
|
+
* // plugins...
|
|
108
|
+
* config: {
|
|
109
|
+
* enumsAsString: false
|
|
110
|
+
* },
|
|
111
|
+
* },
|
|
112
|
+
* },
|
|
113
|
+
* };
|
|
114
|
+
* export default config;
|
|
55
115
|
* ```
|
|
56
116
|
*/
|
|
57
117
|
enumsAsString?: boolean;
|
|
@@ -62,14 +122,21 @@ export interface TypeScriptMongoPluginConfig extends RawConfig {
|
|
|
62
122
|
* @default false
|
|
63
123
|
*
|
|
64
124
|
* @exampleMarkdown
|
|
65
|
-
* ```
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
125
|
+
* ```ts filename="codegen.ts"
|
|
126
|
+
* import type { CodegenConfig } from '@graphql-codegen/cli';
|
|
127
|
+
*
|
|
128
|
+
* const config: CodegenConfig = {
|
|
129
|
+
* // ...
|
|
130
|
+
* generates: {
|
|
131
|
+
* 'path/to/file.ts': {
|
|
132
|
+
* // plugins...
|
|
133
|
+
* config: {
|
|
134
|
+
* avoidOptionals: true
|
|
135
|
+
* },
|
|
136
|
+
* },
|
|
137
|
+
* },
|
|
138
|
+
* };
|
|
139
|
+
* export default config;
|
|
73
140
|
* ```
|
|
74
141
|
*/
|
|
75
142
|
avoidOptionals?: boolean;
|