I am brand new to graphQL and I have to retrieve all of the products. I have been looking around, watching tutorials and reading and people seem to return all of a certain type of data they want but I cannot. For example it will throw an error saying you must provide first or last but I want them all or it will say totalCount or count does not exist.
{
products {
id
title
price
}
}
// or get total count of products
{
products {
totalCount
}
}
I was basically trying to do something like that. I understand I may not receive any help because no one has access to my shopify admin api but maybe even an example or anything that I could see. This is from my graphQL query root of options I have for products. List of products.
ProductConnection!
first: Int
Returns up to the first n elements from the list.
after: String
Returns the elements that come after the specified cursor.
last: Int
Returns up to the last n elements from the list.
before: String
Returns the elements that come before the specified cursor.
reverse: Boolean = false
Reverse the order of the underlying list.
sortKey: ProductSortKeys = ID
Sort the underlying list by the given key.
query: String
Supported filter parameters:
barcode
created_at
delivery_profile_id
error_feedback
gift_card
inventory_total
is_price_reduced
out_of_stock_somewhere
price
product_type
publishable_status
published_status
sku
status
tag
title
updated_at
vendor
See the detailed search syntax for more information about using filters.
savedSearchId: ID
ID of an existing saved search. The search’s query string is used as the query argument.