Integrating product data from multiple platforms is a common challenge in ecommerce. Klizer needed to retrieve product data from Akeneo PIM and Magento, ensuring a seamless and unified response. 

Initially, we encountered issues retrieving Akeneo’s product attributes, such as color, weight, and size. To overcome this, we adopted a hybrid approach, combining REST API calls for Akeneo and GraphQL queries for Magento using GraphQL Mesh.

What is GraphQL Mesh?

GraphQL Mesh is an open-source tool that enables seamless data integration from multiple sources, regardless of whether they are GraphQL, REST, gRPC, SOAP, or other APIs. It provides a unified GraphQL interface, allowing developers to query different data sources as if they were a single GraphQL API.

Key Benefits of GraphQL Mesh

  1. Unified API Interface – Combines multiple APIs (GraphQL, REST, SOAP) into a single GraphQL schema.
  2. Schema Stitching – Merges data from different sources dynamically without requiring backend modifications.
  3. Flexibility & Extensibility – Allows custom resolvers and transformation of APIs to suit business requirements.
  4. Improved Performance – Optimizes API requests, reducing multiple calls and enhancing data retrieval speed.
  5. Developer-Friendly – Reduces the complexity of managing different API types and makes data queries more intuitive.

Comparison with the Traditional REST API Approach

GraphQL Mesh provides several advantages over the traditional REST API approach by enabling a more flexible and unified way to interact with different data sources. Below are a few points where MESH gives better results than REST API 

1. Unified API for Multiple Data Sources

GraphQL Mesh:

  • Combines multiple APIs (REST, GraphQL, gRPC, SOAP, databases, etc.) into a single GraphQL endpoint.
  • Provides a seamless way to query multiple services in one request.

REST API:

  • Requires multiple API calls to fetch data from different services.
  • No built-in mechanism for aggregating APIs into a single interface.

2. Better Performance with Fewer API Calls

GraphQL Mesh:

  • Allows batching and parallel execution of requests.
  • Uses intelligent caching to reduce redundant requests.

REST API:

  • Multiple endpoints require sequential API calls, leading to higher latency.

3. Real-Time Capabilities

  • GraphQL Mesh:  Supports real-time data fetching via subscriptions and WebSockets.
  • REST API:  No built-in real-time support; requires polling or WebSocket implementation.

4. Reduces Over-Fetching & Under-Fetching

  • GraphQL Mesh:  Clients can query exactly what they need, reducing unnecessary data transfer. 
  • REST API:   Fixed endpoints often return extra data (over-fetching) or lack necessary fields (under-fetching), requiring additional requests.

Challenges Faced in Akeneo Product Attributes [In Detail]

We initially attempted to retrieve product data from Akeneo PIM and Magento using GraphQL Mesh alone. While we successfully fetched product details from Magento, Akeneo’s product attributes were missing. Since Akeneo primarily uses REST APIs, we had to explore an alternative approach to retrieve attribute data effectively.

1. Our Hybrid Approach

To resolve this, we adopted the following solution:

  1. Use GraphQL Mesh to fetch general product information from Akeneo PIM and Magento.
  2. Make an additional REST API call to Akeneo to retrieve product attributes.
  3. Merge the data using a custom resolver in GraphQL Mesh to provide a unified response.

2. Impact We Made 

  • Successfully integrated Akeneo PIM and Magento into a single GraphQL API.
  • Combined data from GraphQL and REST APIs without modifying backend systems.
  • Enabled seamless retrieval of detailed product attributes and descriptions.
  • Improved API efficiency by reducing redundant queries and minimizing response times.
  • Provided a scalable integration framework for future multi-platform expansions.

3. Optimizing Performance with Redis Cache

We implemented Redis Cache for product data retrieval in the front end to improve its performance. The caching mechanism works as follows:

  1. When a frontend page requests product information, it first checks Redis Cache for the data using the product SKU as the key.
  2. If data exists in the cache, it is immediately returned, and a background process updates the cache by fetching the latest product details from the GraphQL API.
  3. If data is not in the cache, the request is forwarded to the GraphQL Mesh API, the data is fetched and stored in Redis for future requests.
  4. This ensures faster response times while keeping product information up to date.

Benefits of Redis Caching

  • Reduced API Load – Minimizes frequent requests to GraphQL Mesh.
  • Faster Response Time – Cached product data is served instantly, improving front-end performance.
  • Efficient Data Synchronization – Background updates ensure that the cache remains fresh.

Available Solutions for Akeneo and Magento Synchronization

Several solutions are available in the market for integrating Akeneo PIM with Magento. These solutions aim to synchronize product data, attributes, categories, and media efficiently between the two platforms. Here are some of the most widely used options:

1. Akeneo Connector for Magento (Official Extension)

Akeneo offers an official Magento connector, which provides a native synchronization solution between Akeneo PIM and Magento.

 Features:

  • Direct integration with Magento via API.
  • Supports product, attribute, and category synchronization.
  • Allows automatic updates from Akeneo to Magento.
  • Includes mapping and transformation options for product data.

 Limitations:

  • Requires Magento Enterprise Edition for full features.
  • Complex to configure for custom data structures.

2. Third-Party Connectors (Paid Extensions)

Several Magento extension providers offer Akeneo integration plugins, such as:

  • Webkul Akeneo Magento Connector
  • Firebear Studio Akeneo Connector
  • CustomGento Akeneo2Magento Connector

 Features:

  • Quick and easy setup.
  • Pre-built mapping and automation features.
  • Supports multiple store views and multi-language data sync.

 Limitations:

  • Paid extensions with license costs.
  • Does not support all Akeneo/Magento customizations.

GraphQL Mesh vs Traditional Extensions vs REST API Integration

GraphQL Mesh is far better then others like Traditional Extensions or REST API solutions.  Below are only a few points.

FeatureGraphQL MeshTraditional Extensions (e.g., Webkul, Firebear)REST API Integration
Integration TypeMiddleware-based (GraphQL + REST)Direct module-based syncAPI-based custom development
Data Retrieval MethodMerges data from multiple sources dynamicallyUses predefined Akeneo API callsFetches data via REST API endpoints
Flexibility & CustomizationHighly flexible, allows schema transformations & custom resolversLimited to module featuresRequires heavy custom coding
Performance OptimizationUses caching (Redis) & schema stitching for optimized performanceNo built-in caching relies on Magento’s indexingRequires additional caching mechanisms
Real-time Data FetchingSupports real-time queries and background syncData sync is periodic (scheduled jobs)Requires manual or scheduled API sync
Multi-Source SupportCan merge data from Akeneo, Magento, PIMs, ERPs, and REST APIsWorks only with Akeneo & MagentoCan integrate with multiple APIs but requires additional development
Ease of MaintenanceEasier to update & modify using schema transformationsRequires frequent extension updatesHigh maintenance for API modifications
Dependency on Magento/Akeneo VersionsWorks independently of Magento/Akeneo updatesMay require extension updates for compatibilityVersion updates may break API requests
Cost & LicensingOpen-source, only infra costs (Redis, Node.js)Paid extensions with license feesCustom development costs

Integrate Akeneo PIM with GraphQL Mesh in Magento 2 with Klizer  

By leveraging GraphQL Mesh, we effectively bridged the gap between Akeneo’s REST API and Magento’s GraphQL API. This hybrid approach allowed us to integrate multiple data sources, ensuring a flexible, efficient, and scalable product data management solution.

GraphQL Mesh is an excellent choice for businesses that rely on multiple APIs and seek a unified, high-performance, and developer-friendly solution for integrating diverse data sources.Reach out to Klizer, your Adobe Commerce Solutions Partner to help you integrate Akeneo PIM with GraphQL Mesh in the Magento 2 platform.

Picture of Prakash S

Prakash S

Prakash is a Senior Software Engineer with 5 years of experience specializing in Laravel, BigCommerce, GraphQL Mesh, PHP, React, Node.js, and Contentful. Passionate about problem-solving and innovation, he continuously explores new technologies and strives to improve development processes. With a focus on efficiency and scalability, Prakash is dedicated to building impactful applications and staying at the forefront of the tech industry.
Scroll to Top