Strapi GraphQL cannot handle data modification on the fly

Hi, I am experimenting with Strapi using GraphQL and Rest API protocols to query the data from the Strapi CMS, and then using Javascript to find and replace the data placeholder. Once the find and replace process is completed, I return the result using toEntityResponseCollection(objectResult); The Rest API for the controller worked. It recognized the modified data; however, GraphQL did not. I know it is a matter of conversion, but I am too close to the problem. Below is my logic for the GraphQL and Controller.

Rest API Approach - Worked

/**
 *  truth-lending-disclosure controller
 */

// imports
import { factories } from "@strapi/strapi";
import { dataSubstitution } from "../../../libs/helpers/dataSubstitution";
import { risCustomerTermDataMap } from "../../../libs/common/risaCustomerTermDataMap";

// variables declaration
const UID = "api::truth-lending-disclosure.truth-lending-disclosure";

export default factories.createCoreController(UID, ({ strapi }) => ({
  async getCustomerTerms(ctx) {
    console.log("***** Typescript::getCustomerTerms Controller *****");

    const { toEntityResponseCollection } = strapi
      .plugin("graphql")
      .service("format").returnTypes;

    ctx.query = { ...ctx.query };

    // define level to populate
    let _populate = {
      body: {
        populate: {
          section: true,
        },
      },
    };

    // using shadow CRUD from entity service to fetch data
    const entities = await strapi.entityService.findMany(UID, {
      populate: _populate,
    });

    // transform the output
    const sanitizedEntity = await super.sanitizeOutput(entities, ctx);

    // find and replace placeholder with key-value risCustomerTermDataMap
    // return the result as JSON string
    let stringResult = dataSubstitution(
      JSON.stringify(sanitizedEntity),
      risCustomerTermDataMap
    );

    ctx.body = stringResult;

    return toEntityResponseCollection(ctx.body);
  },
}));

GraphQL Approach - Failed to recognize the modified result

 register({ strapi }): void {
    // customized programmatically using GraphQL's extension
    const extensionService = strapi.plugin("graphql").service("extension");
    const UID = "api::truth-lending-disclosure.truth-lending-disclosure";

    extensionService.use(({ strapi }) => ({
      typeDefs: ``,
      resolvers: {
        Query: {
          truthLendingDisclosures: {
            resolve: async (parent, args, context) => {
              // toEntityResponse method to allow us to convert our response
              // to the appropriate format before returning the data.
              const { toEntityResponseCollection } = strapi.service(
                "plugin::graphql.format"
              ).returnTypes;

              // define level to populate
              let _populate = {
                body: {
                  populate: {
                    section: true,
                  },
                },
              };

              // using shadow CRUD from entity service to fetch data
              let entities = await strapi.entityService.findMany(UID, {
                populate: _populate,
              });

              // find and replace placeholder with key-value risCustomerTermDataMap
              // return the result as JSON string
              let stringResult = dataSubstitution(
                JSON.stringify(entities), // convert an object to JSON string
                risCustomerTermDataMap
              );

              // convert JSON string back object
              let objectResult = JSON.parse(stringResult);

              // graphql IDE returned the original entities instead of objectResult
              return toEntityResponseCollection(objectResult);
            },
          },
        },
      },
    }));
  },