INNER CODE UNIT · TypeScript

nestedArgToString

Escape-Technologies/graphman · src/converters.ts:48

function nestedArgToString(arg: Argument, argStr?: string): string {
  if (!argStr) argStr = arg.typeName;
  if (arg.nesting.length === 0) {
    return argStr;
  } else {
    const nesting = arg.nesting.pop();
    if (nesting === "LIST") {
      return `[${nestedArgToString(arg, argStr)}]`;
    } else if (nesting === "NON_NULL") {
      return `${nestedArgToString(arg, argStr)}!`;
    }
  }
  return argStr;
}

function formatArgument(arg: Argument): FormattedArgument {
  const formattedType: string = nestedArgToString(arg);

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…