INNER CODE UNIT · TypeScript

getDefaultValue

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

function getDefaultValue(type: string) {
  switch (type) {
    case "ID":
      return `"0"`;
    case "STRING" || "String":
      return `""`;
    case "INT" || "Int":
      return `0`;
    case "FLOAT":
      return `0.0`;
    case "BOOLEAN":
      return `false`;
    case "INPUT_OBJECT":
      return `{}`;
    default:
      return `null`;
  }
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…