Skip to content

Latest commit

 

History

History
78 lines (56 loc) · 1.84 KB

File metadata and controls

78 lines (56 loc) · 1.84 KB

Getting Started with Magento 2 GraphQL

Overview

This section guides you through setting up your development environment and making your first GraphQL queries.

Topics Covered

  1. Prerequisites
  2. Development Environment Setup
  3. GraphQL Endpoint
  4. GraphQL IDE Tools
    • GraphiQL
    • Altair GraphQL Client
    • Postman
    • GraphQL Playground
  5. Your First Query
  6. Introspection Queries
  7. GraphQL Query Structure
  8. Using Variables
  9. Query Fragments

Learning Objectives

By the end of this section, you will be able to:

  • Set up a development environment for Magento GraphQL
  • Access the GraphQL endpoint
  • Use GraphQL IDE tools
  • Write and execute basic queries
  • Use introspection to explore the schema
  • Understand query structure and syntax
  • Use variables and fragments

Prerequisites

Before starting, ensure you have:

  • Magento 2.3.0 or higher installed
  • Admin access to Magento
  • Basic understanding of HTTP and APIs
  • A GraphQL client tool (GraphiQL, Postman, etc.)

GraphQL Endpoint

Magento's GraphQL endpoint is available at:

https://your-magento-domain.com/graphql

The endpoint accepts:

  • POST requests for queries and mutations
  • GET requests for queries only (with URL parameters)

Quick Start Example

Here's a simple query to test your setup:

{
  storeConfig {
    store_name
    store_code
    locale
    base_currency_code
  }
}

Next Steps

Proceed to Prerequisites to ensure your environment is ready.


← Previous: Introduction | Back to Main | Next: Architecture →