Advertisement
Guest User

Untitled

a guest
Jan 15th, 2024
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. $api = ShopifyApp::api();
  2. // Define the query.
  3. $query =
  4. '{
  5. shop
  6. {
  7. products(first: 1)
  8. {
  9. totalCount
  10. }
  11. }
  12. }';
  13. $response = $api->graph(GraphqlEnum::ADMIN_API, new GraphqlValue($query));
  14. // Total count of products.
  15. $totalCount = $response['data']['shop']['products']['totalCount'];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement