Rework GraphQL proxy to produce response in the same format as the commercetools API

Created on 22 October 2025, 14 days ago

Problem/Motivation

The commercetools GraphQL API returns the data in the "data" object, but our GraphQL proxy returns it in the root object.
Because of this, we implemented an "if" condition to handle this on the frontend - modules/commercetools_decoupled/js/libs/commercetoolsApi.js:

        if (isDirectRequest) {
          // @todo Rework backend GraphQL proxy to return data in the same
          // format as commercetools GraphQL.
          Object.assign(result.body, result.body.data);
          delete result.body.data;
        }

Proposed resolution

We need to fix our GraphQL proxy to produce results in the same format as the direct commercetools API responses and remove this "if" condition.

📌 Task
Status

Active

Version

2.0

Component

Code

Created by

🇦🇲Armenia murz Yerevan, Armenia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024