vuestorefront / vue-storefront

Alokai is a Frontend as a Service solution that simplifies composable commerce. It connects all the technologies needed to build and deploy fast & scalable ecommerce frontends. It guides merchants to deliver exceptional customer experiences quickly and easily.
https://www.alokai.com
MIT License
10.59k stars 2.08k forks source link

chore: enhance-customquery-type #6928

Closed jacobfogolyan closed 1 year ago

jacobfogolyan commented 1 year ago

IN-3334

Description

Comparing examples on Vue Storefront docs on using custom Queries, when sending a customQuery with metadata, the type only allows Record<string, string> However in docs it is explained that you can send metadata as an object which this type doesn't allow.

What it currently supports

      getStores({
        customQuery: {
          getStoresData: 'set-store-data',
          metadata: 'entry1,entry2',
        },
      })

What is needed

     getStores({
        customQuery: {
          getStoresData: 'set-store-data',
          metadata: {
            key1: 'entry1',
            key22: 'entry2',
          },
        },
      })

If this change isn't made, then we would have to split the string by , rather than having metadata.objectKey.

How Has This Been Tested?

This was tested on an existing codebase

Checklist:

Changelog

Tests

Code standards

Docs