UNPKG

331 BJavaScriptView Raw
1/**
2 * Get the key under which the result of this resolver will be placed in the response JSON. Basically, just
3 * resolves aliases.
4 * @param info The info argument to the resolver.
5 */
6export function getResponseKeyFromInfo(info) {
7 return info.fieldNodes[0].alias != null ? info.fieldNodes[0].alias.value : info.fieldName;
8}