- added
sort
andreverse
options toshopify.products
- the default value for
sort
isBEST_SELLING
- the default value for
- added
filters
option toshopify.products_in_collection
- previously, these collection queries had filter
available: true
hard-coded - now we want to be able to display sold-out items on purpose
- so, we've changed the default behavior -- now, sold-out items will be returned in collection queries
- we've added
filters
option, where you can supply shopify graphql filters, currently, only specifyingavailable
is supported - to return only in-stock products, provide
filters: [{available: true}]
- to return only out-of-stock products, provide
filters: [{available: false}]
- to return all the products, provide
filters: []
orfilters: [{}]
- previously, these collection queries had filter
- (!) tweaked
shopify.specific_products
return type- used to be
Promise<GqlProduct[]>
- now is
Promise<(GqlProduct | null)[]>
- used to be
shopify.checkout
now silently discards items with zero quantity
- (!) rework pagination
- our generators no longer use
return
statements - instead, all values are supplied via
yield
- this fixes a bug with
for await
loops -- for loops ignore returned data - this means we cannot use native
done
as a signal for the end of the data (whendone
is true, thevalue
is discarded by for loops) - so we've implemented our own
PageReport<N>
type andPageGenerator<N>
typeconst {value, done} = await page_generator.next() const [nodes, more] = value!
- now we rely on our own
more
instead ofdone
to indicate that no more nodes are available
- now we rely on our own
- our generators no longer use
- (!) rename
ShepherdError
toShopifyShepherdError
- (!) change Shopify constructor signature to use an options object
- (!) make various Gql types optional, like variant.image, product.featuredImage, etc
- add
shopify.checkout({line_items: []})
- add
shopify.specific_products({ids: []})
- i reorganized the directories and files a lot, but i don't think there are any breaking changes
- added
Shopify.first
helper for getting only the first page - add
shopify.product()
for getting info on a single product - add
ShopifyNotFoundError