- Purpose: Product catalog (list + detail).
- Base path:
/api/products
kubectl -n cloudshopt exec -it cloudshopt-mysql-0 -- bash
# mysql -u root -prootpass
CREATE DATABASE cloudshopt_products CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'users'@'%' IDENTIFIED BY 'CHANGE_ME_PASSWORD';
GRANT ALL PRIVILEGES ON cloudshopt_products.* TO 'users'@'%';
FLUSH PRIVILEGES;
kubectl exec -n cloudshopt -it deploy/product-service -c app -- sh
# php artisan migrate
This service exposes a GraphQL API (powered by Lighthouse) for querying product data.
POST /api/products/graphql
type Product {
id: ID!
name: String!
description: String
price: Float!
}
type Query {
products: [Product!]! @all
product(id: ID! @whereKey): Product @find
}