Skip to content

Commit

Permalink
feat: support graphql-kotlin ID scalar (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
danadajian authored Mar 20, 2024
1 parent dcede66 commit 739cdbe
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/helpers/build-type-metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions test/unit/should_support_custom_scalars/expected.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
1 change: 1 addition & 0 deletions test/unit/should_support_custom_scalars/schema.graphql
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
scalar URL

type MyScalarType {
idField: ID
field: URL
field2: URL!
}
Expand Down

0 comments on commit 739cdbe

Please sign in to comment.