Stylianos Gakis
02/23/2022, 11:15 PMStylianos Gakis
02/23/2022, 11:16 PMjava.lang.ArithmeticException: / by zero
from this line. Itās non obvious to me what I couldāve potentially done wrong. The last line that comes from the generated code looks something like:
public class DataBuilder1 : MapBuilder() {
public var location: String by StubbedProperty(__map, "location")
public override fun build(): Map<String, Any?> = mapOf(
"location" to resolve("location", EmbarkExternalRedirectLocation.type.notNull()),
)
}
where EmbarkExternalRedirectLocation is:
public enum class EmbarkExternalRedirectLocation(
public val rawValue: String
) {
MailingList("MailingList"),
Offer("Offer"),
Close("Close"),
Chat("Chat"),
/**
* Auto generated constant for unknown enum values
*/
UNKNOWN__("UNKNOWN__"),
;
public companion object {
public val type: EnumType = EnumType("EmbarkExternalRedirectLocation")
public fun safeValueOf(rawValue: String): EmbarkExternalRedirectLocation =
values().find { it.rawValue == rawValue } ?: UNKNOWN__
}
}
Stylianos Gakis
02/23/2022, 11:56 PMStylianos Gakis
02/23/2022, 11:56 PMlocation
in my schema is defined as the aforementioned Enum, I get to populate it as a normal string? Is that expected? Itād be nice to be able to have a type in there instead right? Changing it to a sealed class by adding it to sealedClassesForEnumsMatching
doesnāt seem to change that eitherStylianos Gakis
02/24/2022, 12:18 AMmbonnin
02/24/2022, 12:35 AMmbonnin
02/24/2022, 12:35 AMmbonnin
02/24/2022, 12:42 AMStylianos Gakis
02/24/2022, 12:43 AMStylianos Gakis
02/24/2022, 12:49 AMlocal.properties
file with something similar to sdk.dir=/Users/stylianosgakis/Library/Android/sdk
if opening from IntelliJ instead of AS
⢠Go inside the .graphqls file thatās automatically generated and search for the text āWhen weāve deleted an itemā and remove the extra string ticks \"""
above and below that comment. Itās a known problem we have in our schema which is just very annoying and I donāt know how to fix xDStylianos Gakis
02/24/2022, 12:52 AM./gradlew :shared:cleanTestDebugUnitTest :shared:testDebugUnitTest --tests "com.hedvig.embarkx.embark.story.GetEmbarkStoryUseCaseTest.successfulRequestReturnsTheContainingData" --debug
is the one that brings up the exceptionmbonnin
02/24/2022, 12:53 AMStylianos Gakis
02/24/2022, 12:54 AMmbonnin
02/24/2022, 1:01 AMmbonnin
02/24/2022, 1:01 AMmbonnin
02/24/2022, 1:02 AMStylianos Gakis
02/24/2022, 1:07 AMmbonnin
02/24/2022, 1:10 AMmbonnin
02/24/2022, 1:11 AMmbonnin
02/24/2022, 1:15 AMtasks.register("updateSchema") {
dependsOn("downloadGiraffeSchemaFromIntrospection")
inputs.file(downloadedSchema)
outputs.file(patchedSchema)
doLast {
patchedSchema.writeText(downloadedSchema.readText().replace("\\\"\"\"", ""))
}
}
Stylianos Gakis
02/24/2022, 1:21 AMmbonnin
02/24/2022, 1:22 AMmbonnin
02/24/2022, 1:23 AMmbonnin
02/24/2022, 5:38 PMannsofi
03/14/2022, 8:25 AMresolutions
field):
public class ConsumptionAnalysisBuilder : MapBuilder() {
public var valuesFrom: String? by StubbedProperty(__map, "valuesFrom")
public var valuesTo: String? by StubbedProperty(__map, "valuesTo")
public var resolutions: List<String> by StubbedProperty(__map, "resolutions")
public override fun build(): Map<String, Any?> = mapOf(
"valuesFrom" to resolve("valuesFrom", GraphQLString.type),
"valuesTo" to resolve("valuesTo", GraphQLString.type),
"resolutions" to resolve("resolutions", Resolution.type.notNull().list().notNull()),
)
}
mbonnin
03/14/2022, 8:54 AMannsofi
03/14/2022, 8:56 AMannsofi
03/14/2022, 9:20 AMmbonnin
03/14/2022, 9:22 AMannsofi
03/14/2022, 9:25 AM