VerachadW / kraph

GraphQL request string builder written in Kotlin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to pass listOf object to mutation

blacroix opened this issue · comments

Hello,
Prior 0.4.1 I was able to pass a list of object using:
val lookMediaInputs = listOf("{title: \"${media.title}\", type: \"${media.type}\", fileFieldname: \"${media.fileFieldname}\"}")
and
mapOf("lookMediaInputs" to lookMediaInputs)
I cannot do that anymore, so how can I pass a list of object to mapOf for a mutation?
Thanks!

More information, prior to 0.4.1 String generated looks like:

lookMediaInputs: [{title: "#blue #color #selfie", type: "image", fileFieldname: "imageFile"}]

After it looks like:

lookMediaInputs: ["{title: "#blue #color #selfie", type: "image", fileFieldname: "imageFile"}"]

@blacroix I will release the new version soon. Need to add a couple of things before.

@blacroix I already publish v.0.5.1 which include the fix for this one. Please check how to pass the object parameter from here. https://github.com/VerachadW/kraph/blob/master/core/src/test/kotlin/me/lazmaid/kraph/test/GraphQLPrintSpek.kt#L69-L82