@graphql-codegen/kotlin 2.2.6-alpha-cb3f44ae4.0 → 2.2.6
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/config.d.ts +15 -0
- package/index.js +2 -1
- package/index.mjs +2 -1
- package/package.json +3 -3
- package/visitor.d.ts +1 -0
package/config.d.ts
CHANGED
|
@@ -56,4 +56,19 @@ export interface KotlinResolversPluginRawConfig extends RawConfig {
|
|
|
56
56
|
* ```
|
|
57
57
|
*/
|
|
58
58
|
withTypes?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* @default false
|
|
61
|
+
* @description Allow you to omit JvmStatic annotation
|
|
62
|
+
*
|
|
63
|
+
* @exampleMarkdoWn
|
|
64
|
+
* ```yml
|
|
65
|
+
* generates:
|
|
66
|
+
* src/main/kotlin/my-org/my-app/Types.kt:
|
|
67
|
+
* plugins:
|
|
68
|
+
* - kotlin
|
|
69
|
+
* config:
|
|
70
|
+
* omitJvmStatic: true
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
omitJvmStatic?: boolean;
|
|
59
74
|
}
|
package/index.js
CHANGED
|
@@ -23,6 +23,7 @@ class KotlinResolversVisitor extends visitorPluginCommon.BaseVisitor {
|
|
|
23
23
|
withTypes: rawConfig.withTypes || false,
|
|
24
24
|
package: rawConfig.package || defaultPackageName,
|
|
25
25
|
scalars: visitorPluginCommon.buildScalarsFromConfig(_schema, rawConfig, KOTLIN_SCALARS),
|
|
26
|
+
omitJvmStatic: rawConfig.omitJvmStatic || false,
|
|
26
27
|
});
|
|
27
28
|
this._schema = _schema;
|
|
28
29
|
}
|
|
@@ -50,7 +51,7 @@ class KotlinResolversVisitor extends visitorPluginCommon.BaseVisitor {
|
|
|
50
51
|
${enumValues}
|
|
51
52
|
|
|
52
53
|
companion object {
|
|
53
|
-
@JvmStatic
|
|
54
|
+
${this.config.omitJvmStatic ? '' : '@JvmStatic'}
|
|
54
55
|
fun valueOfLabel(label: String): ${enumName}? {
|
|
55
56
|
return values().find { it.label == label }
|
|
56
57
|
}
|
package/index.mjs
CHANGED
|
@@ -19,6 +19,7 @@ class KotlinResolversVisitor extends BaseVisitor {
|
|
|
19
19
|
withTypes: rawConfig.withTypes || false,
|
|
20
20
|
package: rawConfig.package || defaultPackageName,
|
|
21
21
|
scalars: buildScalarsFromConfig(_schema, rawConfig, KOTLIN_SCALARS),
|
|
22
|
+
omitJvmStatic: rawConfig.omitJvmStatic || false,
|
|
22
23
|
});
|
|
23
24
|
this._schema = _schema;
|
|
24
25
|
}
|
|
@@ -46,7 +47,7 @@ class KotlinResolversVisitor extends BaseVisitor {
|
|
|
46
47
|
${enumValues}
|
|
47
48
|
|
|
48
49
|
companion object {
|
|
49
|
-
@JvmStatic
|
|
50
|
+
${this.config.omitJvmStatic ? '' : '@JvmStatic'}
|
|
50
51
|
fun valueOfLabel(label: String): ${enumName}? {
|
|
51
52
|
return values().find { it.label == label }
|
|
52
53
|
}
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-codegen/kotlin",
|
|
3
|
-
"version": "2.2.6
|
|
3
|
+
"version": "2.2.6",
|
|
4
4
|
"description": "GraphQL Code Generator plugin for generating Kotlin code based on a GraphQL schema",
|
|
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/java-common": "2.1.
|
|
9
|
+
"@graphql-codegen/java-common": "^2.1.12",
|
|
10
10
|
"@graphql-codegen/plugin-helpers": "^2.4.0",
|
|
11
|
-
"@graphql-codegen/visitor-plugin-common": "2.7.
|
|
11
|
+
"@graphql-codegen/visitor-plugin-common": "2.7.1",
|
|
12
12
|
"tslib": "~2.3.0"
|
|
13
13
|
},
|
|
14
14
|
"repository": {
|
package/visitor.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export interface KotlinResolverParsedConfig extends ParsedConfig {
|
|
|
13
13
|
listType: string;
|
|
14
14
|
enumValues: EnumValuesMap;
|
|
15
15
|
withTypes: boolean;
|
|
16
|
+
omitJvmStatic: boolean;
|
|
16
17
|
}
|
|
17
18
|
export interface FieldDefinitionReturnType {
|
|
18
19
|
inputTransformer?: ((typeName: string) => string) | FieldDefinitionNode;
|