Created
April 28, 2020 00:16
-
-
Save wesleyalmd/2cdde0c1653e50cff566a7a5e2a5bde4 to your computer and use it in GitHub Desktop.
M2 GraphQL - Get Products by Category
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query getProductsByCategoryId( | |
$currentPage: Int = 1 | |
$pageSize: Int = 12 | |
$categoryId: String! | |
) { | |
products( | |
currentPage: $currentPage | |
pageSize: $pageSize | |
search: "" | |
filter: { | |
category_id: { | |
eq: $categoryId | |
} | |
} | |
) { | |
items { | |
id | |
name | |
small_image { | |
url | |
} | |
url_key | |
price { | |
regularPrice { | |
amount { | |
value | |
currency | |
} | |
} | |
} | |
} | |
page_info { | |
total_pages | |
} | |
total_count | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
query variables