-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #443 from Netflix/feature/jvm-name
Use an explicit JVM generated name for all kotlin2 data classes
- Loading branch information
Showing
112 changed files
with
566 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
...lin/com/netflix/graphql/dgs/codegen/cases/dataClassWithBooleanField/expected/DgsClient.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.netflix.graphql.dgs.codegen.cases.dataClassWithBooleanField.expected | ||
|
||
import com.netflix.graphql.dgs.codegen.GraphQLProjection | ||
import com.netflix.graphql.dgs.codegen.cases.dataClassWithBooleanField.expected.client.QueryProjection | ||
import graphql.language.OperationDefinition | ||
import kotlin.String | ||
|
||
public object DgsClient { | ||
public fun buildQuery(_projection: QueryProjection.() -> QueryProjection): String = | ||
GraphQLProjection.asQuery(OperationDefinition.Operation.QUERY, QueryProjection(), _projection) | ||
} |
19 changes: 19 additions & 0 deletions
19
.../com/netflix/graphql/dgs/codegen/cases/dataClassWithBooleanField/expected/DgsConstants.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.netflix.graphql.dgs.codegen.cases.dataClassWithBooleanField.expected | ||
|
||
import kotlin.String | ||
|
||
public object DgsConstants { | ||
public const val QUERY_TYPE: String = "Query" | ||
|
||
public object QUERY { | ||
public const val TYPE_NAME: String = "Query" | ||
|
||
public const val Test: String = "test" | ||
} | ||
|
||
public object REQUIREDTESTTYPE { | ||
public const val TYPE_NAME: String = "RequiredTestType" | ||
|
||
public const val IsRequired: String = "isRequired" | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...ix/graphql/dgs/codegen/cases/dataClassWithBooleanField/expected/client/QueryProjection.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.netflix.graphql.dgs.codegen.cases.dataClassWithBooleanField.expected.client | ||
|
||
import com.netflix.graphql.dgs.codegen.GraphQLProjection | ||
|
||
public class QueryProjection : GraphQLProjection() { | ||
public fun test(_projection: RequiredTestTypeProjection.() -> RequiredTestTypeProjection): | ||
QueryProjection { | ||
field("test", RequiredTestTypeProjection(), _projection) | ||
return this | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...dgs/codegen/cases/dataClassWithBooleanField/expected/client/RequiredTestTypeProjection.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.netflix.graphql.dgs.codegen.cases.dataClassWithBooleanField.expected.client | ||
|
||
import com.netflix.graphql.dgs.codegen.GraphQLProjection | ||
|
||
public class RequiredTestTypeProjection : GraphQLProjection() { | ||
public val isRequired: RequiredTestTypeProjection | ||
get() { | ||
field("isRequired") | ||
return this | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
...n/com/netflix/graphql/dgs/codegen/cases/dataClassWithBooleanField/expected/types/Query.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.netflix.graphql.dgs.codegen.cases.dataClassWithBooleanField.expected.types | ||
|
||
import com.fasterxml.jackson.`annotation`.JsonIgnoreProperties | ||
import com.fasterxml.jackson.`annotation`.JsonProperty | ||
import com.fasterxml.jackson.`annotation`.JsonTypeInfo | ||
import com.fasterxml.jackson.databind.`annotation`.JsonDeserialize | ||
import com.fasterxml.jackson.databind.`annotation`.JsonPOJOBuilder | ||
import java.lang.IllegalStateException | ||
import kotlin.jvm.JvmName | ||
|
||
@JsonTypeInfo(use = JsonTypeInfo.Id.NONE) | ||
@JsonDeserialize(builder = Query.Builder::class) | ||
public class Query( | ||
test: () -> RequiredTestType? = testDefault, | ||
) { | ||
private val _test: () -> RequiredTestType? = test | ||
|
||
@get:JvmName("getTest") | ||
public val test: RequiredTestType? | ||
get() = _test.invoke() | ||
|
||
public companion object { | ||
private val testDefault: () -> RequiredTestType? = | ||
{ throw IllegalStateException("Field `test` was not requested") } | ||
|
||
} | ||
|
||
@JsonPOJOBuilder | ||
@JsonIgnoreProperties("__typename") | ||
public class Builder { | ||
private var test: () -> RequiredTestType? = testDefault | ||
|
||
@JsonProperty("test") | ||
public fun withTest(test: RequiredTestType?): Builder = this.apply { | ||
this.test = { test } | ||
} | ||
|
||
public fun build() = Query( | ||
test = test, | ||
) | ||
} | ||
} |
Oops, something went wrong.