diff --git a/src/helpers/build-type-metadata.ts b/src/helpers/build-type-metadata.ts index 637555b..2682774 100644 --- a/src/helpers/build-type-metadata.ts +++ b/src/helpers/build-type-metadata.ts @@ -100,7 +100,7 @@ export function buildListType(typeNode: TypeNode, typeName: string) { export const KOTLIN_SCALARS = [ { scalarName: "ID", - kotlinType: "String", + kotlinType: "com.expediagroup.graphql.generator.scalars.ID", }, { scalarName: "String", diff --git a/test/unit/should_support_custom_scalars/expected.kt b/test/unit/should_support_custom_scalars/expected.kt index 25eb236..0043250 100644 --- a/test/unit/should_support_custom_scalars/expected.kt +++ b/test/unit/should_support_custom_scalars/expected.kt @@ -3,6 +3,7 @@ package com.kotlin.generated import com.expediagroup.graphql.generator.annotations.* data class MyScalarType( + val idField: com.expediagroup.graphql.generator.scalars.ID? = null, val field: URL? = null, val field2: URL ) diff --git a/test/unit/should_support_custom_scalars/schema.graphql b/test/unit/should_support_custom_scalars/schema.graphql index 80ae8a4..ae7aaa3 100644 --- a/test/unit/should_support_custom_scalars/schema.graphql +++ b/test/unit/should_support_custom_scalars/schema.graphql @@ -1,6 +1,7 @@ scalar URL type MyScalarType { + idField: ID field: URL field2: URL! }