Skip to content

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:

DocumentationDescription
📖 IntroductionGet started with GraphQL basics and API overview
🔐 AuthenticationLearn all authentication methods and token management
🛍️ Shop APICustomer-facing e-commerce operations reference
👨‍💼 Admin APIAdministrative operations and management reference
🎮 Playground GuideInteractive testing with sample queries
💻 Integration GuidesCode examples for multiple programming languages
💡 Best PracticesPerformance, 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:

For Admin Dashboards:

For Your Programming Language:

2. Test in Playground

3. Implement in Your App

Documentation Structure

Core Documentation

  1. Introduction - GraphQL fundamentals, setup, and endpoints
  2. Authentication - All auth methods (guest, customer, admin)
  3. Shop API - Complete Shop API with all queries and mutations

Advanced Documentation

  1. Admin API - Admin operations for management tasks
  2. Playground Guide - Interactive testing with sample queries
  3. Integration Guides - Code examples for:
    • JavaScript / Node.js / React / Next.js
    • Python / Django
    • PHP / Laravel
    • Ruby / Rails
    • Go
    • Java

Best Practices

  1. 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

EndpointPurposeAuthentication
/api/graphqlMain GraphQL APIOptional (Shop) / Required (Admin)
/api/graphiqlGraphiQL PlaygroundNone
/api/sandboxApollo Sandbox UINone

Get Products

graphql
query {
  products(channel: "default", first: 10) {
    edges {
      node {
        id
        name
        price
      }
    }
  }
}

See more Shop API queries →

Customer Login

graphql
mutation {
  createLogin(input: {
    email: "[email protected]"
    password: "password"
  }) {
    accessToken
  }
}

See more Auth examples →

Create Order

graphql
mutation {
  createOrder(input: {
    cartId: "CART_ID"
    billingAddressId: "ADDRESS_ID"
    shippingMethod: "flatrate_flatrate"
    paymentMethod: "paypal"
  }) {
    order {
      id
      incrementId
    }
  }
}

See complete checkout flow →

Getting Help

ResourcePurpose
🎮 Live PlaygroundTest queries instantly
📚 DocumentationComprehensive guides
💬 Community ForumAsk questions
🐛 Issue TrackerReport bugs
📧 Contact SupportEnterprise 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

Released under the MIT License.