getResponseKeyFromInfo.js 499 B

123456789101112
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.getResponseKeyFromInfo = void 0;
  4. /**
  5. * Get the key under which the result of this resolver will be placed in the response JSON. Basically, just
  6. * resolves aliases.
  7. * @param info The info argument to the resolver.
  8. */
  9. function getResponseKeyFromInfo(info) {
  10. return info.fieldNodes[0].alias != null ? info.fieldNodes[0].alias.value : info.fieldName;
  11. }
  12. exports.getResponseKeyFromInfo = getResponseKeyFromInfo;