How to collectionByHandle in v15 (2022-10) of the Android SDK using Kotlin

layer2software
Tourist
8 0 3

Hi! I'm trying to convert this collectionByHandle to the latest:

 

val promotedProducts: Storefront.QueryRootQuery = Storefront.query { rootQuery ->
    rootQuery.collectionByHandle(BuildConfig.COLLECTION_PROMOTED_PRODUCTS) { collectionQuery ->
        collectionQuery.products(
            {
                it.first(PROMOTED_PRODUCTS_COUNT)
            },
            { productConnectionQuery ->
                productConnectionQuery.edges { productEdgeQuery ->
                    productEdgeQuery.node { productQuery ->
// ...

I've been trying different things for way too long, so I thought I'd ask for help, please.  My best try is this, which still doesn't compile:

rootQuery.collections(first: PROMOTED_PRODUCTS_COUNT, query: BuildConfig.COLLECTION_PROMOTED_PRODUCTS) { collections -> }

Thank you in advance!

Replies 0 (0)