Skip to content

Latest commit

 

History

History
130 lines (108 loc) · 2.81 KB

File metadata and controls

130 lines (108 loc) · 2.81 KB

Built-in GraphQL Functionality

Overview

Magento 2 comes with comprehensive GraphQL coverage for most e-commerce operations. This section explores all available queries and mutations.

Topics Covered

  1. Catalog Operations
    • Product queries
    • Category queries
    • Product search and filtering
    • Product types (simple, configurable, grouped, bundle)
    • Custom attributes
    • Reviews and ratings
  2. Customer Operations
    • Customer registration
    • Customer authentication
    • Profile management
    • Address management
    • Order history
    • Wishlist operations
  3. Cart & Checkout
    • Cart creation and management
    • Adding products to cart
    • Shipping methods
    • Payment methods
    • Order placement
    • Guest checkout
  4. CMS & Store Config
    • CMS pages and blocks
    • Store configuration
    • Currency
    • Countries
    • Available stores
  5. Additional Features
    • Compare products
    • Recently viewed
    • Gift cards
    • Reward points
    • Store credit

Learning Objectives

By the end of this section, you will:

  • Know all available built-in queries and mutations
  • Understand how to query different product types
  • Be able to implement cart and checkout flows
  • Know how to fetch CMS content
  • Understand customer authentication flows

Most Common Queries

Get Products

{
  products(
    filter: { sku: { eq: "24-MB01" } }
  ) {
    items {
      sku
      name
      price {
        regularPrice {
          amount {
            value
            currency
          }
        }
      }
    }
  }
}

Get Categories

{
  categoryList {
    id
    name
    url_path
    children {
      id
      name
    }
  }
}

Customer Token

mutation {
  generateCustomerToken(
    email: "customer@example.com"
    password: "password123"
  ) {
    token
  }
}

Create Cart

mutation {
  createEmptyCart
}

Query Examples by Use Case

Next Steps

Explore each section to learn about specific functionality, starting with Catalog Operations.


← Previous: Architecture | Back to Main | Next: Custom Endpoints →