INNER CODE UNIT · TypeScript

objectFormat

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

  function objectFormat(field: ObjectField) {
    return `# ${field.name}${description}\n`;
  }

  function othersFormat(field: ObjectField) {
    return `# ${field.name}${description} # Type: ${field.typeBaseKind}\n`;
  }

  let formattedFieldStr = "";
  if (field.typeBaseKind === "SCALAR" || field.typeBaseKind === "ENUM") {
    formattedFieldStr = scalarFormat(field);
  } else if (
    field.typeBaseKind === "OBJECT" || field.typeBaseKind === "INTERFACE"
  ) {
    formattedFieldStr = objectFormat(field);
  } else {
    formattedFieldStr = othersFormat(field);
  }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…