GraphQL API
Bagisto's GraphQL API delivers a modern, flexible approach to e-commerce data access. Built on Laravel Lighthouse, it provides efficient querying capabilities perfect for headless commerce, mobile apps, and modern frontend frameworks.
🚀 Quick Navigation
Choose your next step:
| Documentation | Description |
|---|---|
| 📖 Introduction | Get started with GraphQL basics and API overview |
| 🔐 Authentication | Learn all authentication methods and token management |
| 🛍️ Shop API | Customer-facing e-commerce operations reference |
| 👨💼 Admin API | Administrative operations and management reference |
| 🎮 Playground Guide | Interactive testing with sample queries |
| 💻 Integration Guides | Code examples for multiple programming languages |
| 💡 Best Practices | Performance, security, and testing best practices |
🌐 Live Playground
Test queries instantly without any setup:
🎮 GraphQL Playground - Interactive query builder with schema explorer
Key Features
✨ Developer Friendly
- Interactive GraphiQL playground
- Auto-complete and schema documentation
- Copy as cURL functionality
- Real-time error reporting
🚀 High Performance
- Request only the data you need
- Cursor-based pagination
- Query optimization tools
- Caching support
🔒 Secure
- Multiple authentication methods
- Guest checkout support
- Token-based security
- Rate limiting
📱 Mobile Ready
- Optimized for low bandwidth
- Small payload sizes
- Perfect for native apps
What Can You Build?
- 🛒 Headless storefronts and e-commerce sites
- 📱 Mobile apps (iOS & Android)
- 🔄 Third-party integrations and marketplaces
- 📊 Analytics dashboards
- ⚡ Progressive Web Apps (PWA)
- 🤖 AI-powered shopping assistants
Quick Start
1. Choose Your Path
For Building Customer-Facing Apps:
- Start with Shop API Reference
- Learn Authentication Methods
For Admin Dashboards:
- Start with Admin API Reference
- Review Permission Requirements
For Your Programming Language:
- Find your language in Integration Guides
- Copy-paste code examples and adapt
2. Test in Playground
- Visit GraphQL Playground
- Try Sample Queries
- Explore the Schema
3. Implement in Your App
- Follow the Authentication Guide
- Use examples from Integration Guides
- Apply Best Practices
Documentation Structure
Core Documentation
- Introduction - GraphQL fundamentals, setup, and endpoints
- Authentication - All auth methods (guest, customer, admin)
- Shop API - Complete Shop API with all queries and mutations
Advanced Documentation
- Admin API - Admin operations for management tasks
- Playground Guide - Interactive testing with sample queries
- Integration Guides - Code examples for:
- JavaScript / Node.js / React / Next.js
- Python / Django
- PHP / Laravel
- Ruby / Rails
- Go
- Java
Best Practices
- Best Practices - Performance optimization, security, testing, debugging
Common Use Cases
Building a Headless Storefront
1. Get Products → [Shop API - Products](/api/graphql-api/shop-api#products)
2. Manage Cart → [Shop API - Shopping Cart](/api/graphql-api/shop-api#shopping-cart)
3. Checkout → [Shop API - Checkout](/api/graphql-api/shop-api#checkout)
4. Learn Auth → [Authentication Guide](/api/graphql-api/authentication)Building a Mobile App
1. Learn Guest Auth → [Authentication - Guest](/api/graphql-api/authentication#1-guest-checkout-authentication)
2. Browse Products → [Shop API - Products](/api/graphql-api/shop-api#products)
3. Integrate Language → [Integration Guides](/api/graphql-api/integrations)
4. Apply Best Practices → [Best Practices](/api/graphql-api/best-practices)Building an Admin Dashboard
1. Admin Login → [Authentication - Admin](/api/graphql-api/authentication#3-admin-authentication)
2. Manage Data → [Admin API Reference](/api/graphql-api/admin-api)
3. Optimize Performance → [Best Practices - Performance](/api/graphql-api/best-practices#performance-optimization)
4. Implement Testing → [Best Practices - Testing](/api/graphql-api/best-practices#testing)Building a Third-Party Integration
1. Choose Auth Method → [Authentication Guide](/api/graphql-api/authentication)
2. Decide Shop or Admin → [Shop API](/api/graphql-api/shop-api) or [Admin API](/api/graphql-api/admin-api)
3. Select Language → [Integration Guides](/api/graphql-api/integrations)
4. Handle Errors → [Best Practices - Error Handling](/api/graphql-api/best-practices#error-handling)API Endpoints
| Endpoint | Purpose | Authentication |
|---|---|---|
/api/graphql | Main GraphQL API | Optional (Shop) / Required (Admin) |
/api/graphiql | GraphiQL Playground | None |
/api/sandbox | Apollo Sandbox UI | None |
Popular Queries
Get Products
graphql
query {
products(channel: "default", first: 10) {
edges {
node {
id
name
price
}
}
}
}Customer Login
graphql
mutation {
createLogin(input: {
email: "[email protected]"
password: "password"
}) {
accessToken
}
}Create Order
graphql
mutation {
createOrder(input: {
cartId: "CART_ID"
billingAddressId: "ADDRESS_ID"
shippingMethod: "flatrate_flatrate"
paymentMethod: "paypal"
}) {
order {
id
incrementId
}
}
}Getting Help
| Resource | Purpose |
|---|---|
| 🎮 Live Playground | Test queries instantly |
| 📚 Documentation | Comprehensive guides |
| 💬 Community Forum | Ask questions |
| 🐛 Issue Tracker | Report bugs |
| 📧 Contact Support | Enterprise support |
Start Building Today!
👉 New to GraphQL? Start with Introduction
👉 Ready to code? Choose your language in Integration Guides
👉 Want to test? Visit GraphQL Playground

