Skip to content

Commit 739cdbe

Browse files
authored
feat: support graphql-kotlin ID scalar (#16)
1 parent dcede66 commit 739cdbe

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

src/helpers/build-type-metadata.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export function buildListType(typeNode: TypeNode, typeName: string) {
100100
export const KOTLIN_SCALARS = [
101101
{
102102
scalarName: "ID",
103-
kotlinType: "String",
103+
kotlinType: "com.expediagroup.graphql.generator.scalars.ID",
104104
},
105105
{
106106
scalarName: "String",

test/unit/should_support_custom_scalars/expected.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package com.kotlin.generated
33
import com.expediagroup.graphql.generator.annotations.*
44

55
data class MyScalarType(
6+
val idField: com.expediagroup.graphql.generator.scalars.ID? = null,
67
val field: URL? = null,
78
val field2: URL
89
)

test/unit/should_support_custom_scalars/schema.graphql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
scalar URL
22

33
type MyScalarType {
4+
idField: ID
45
field: URL
56
field2: URL!
67
}

0 commit comments

Comments
 (0)