diff --git a/src/logics/utils.ts b/src/logics/utils.ts index 7e926df..c707953 100644 --- a/src/logics/utils.ts +++ b/src/logics/utils.ts @@ -57,6 +57,9 @@ export interface GraphOptions { } const selectRandomField = (obj: any) => { + // default to name if exists + if ('name' in obj) return 'name'; + if ('Name' in obj) return 'Name'; let firstKey; for (firstKey in obj) break; return firstKey;