Summary
A wrong indentation in generated classes causes a compilation error.
Description
Apollo 1.4.4 generates a function Mapper() and indents its content in a wrong way when the generic type is too long.
Example:
@Suppress("FunctionName")
fun Mapper(): ResponseFieldMapper<VeryVeryLongMutationTypeOrQueryTypeHere> = ResponseFieldMapper
{ invoke(it) } // This is actually on a new line but should be in the previous one
The compilation error is Expecting member declaration on ResponseFieldMapper.
By moving the { invoke(it) } next to ResponseFieldMapper, the error disappears.
Version
Introduced in 1.4.4.
Apollo 1.4.3 does not generate the Mapper() function, so there is no compilation error.
I'm looking into this. This looks like it is out of our control. It might a bug in KotlinPoet.
No it is not. As it is mentioned here, there is a way to control the wrapping. Doing a fix now. https://github.com/square/kotlinpoet/issues/695
Most helpful comment
I'm looking into this. This looks like it is out of our control. It might a bug in KotlinPoet.