I tried also to remove the beginObject() from my block of code, but the exception is still thrown.Īny suggestion on how to avoid this Nesting problem? ObjectiveQuery_().nullable().toJson(this, CustomScalarAdapters.Empty, checkNotNull()) I’m not sure how to get a proper instance of the JsonWriter, currently I’m doing it like this: val buffer = Buffer() JsonScope.EMPTY_DOCUMENT -> replaceTop(JsonScope.NONEMPTY_DOCUMENT)Įlse -> throw IllegalStateException("Nesting problem.") Public override fun serializeVariables(writer: JsonWriter,ĬustomScalarAdapters: CustomScalarAdapters): Unit Public override fun name(): String = OPERATION_NAME Public override fun document(): String = OPERATION_DOCUMENT Public override fun id(): String = OPERATION_ID Public val pageSize: Optional = Optional.Absent, Public val page: Optional = Optional.Absent, Public val searchString: Optional = Optional.Absent, I saw that the Query has already something related to this: public data class ExpertSearchQuery( Normally I would just use a library like Moshi or rialization and add the proper annotation to the class I want to serialize but, since this data classes are autogenerated, I can’t do that.īut Apollo Kotlin is already (de)serializing them so I was wondering if there is a way to use the internal serialization mechanism from Apollo Kotlin to (de)serialize these autogenerated data classes. I need to (de)serialize to and from JSON some of the data classes that are autogenerated by Apollo Kotlin.
0 Comments
Leave a Reply. |