Skip to content

Commit 3612e37

Browse files
committed
1 parent d423871 commit 3612e37

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

rds/index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@ export function toJsonObject(inputStr) {
2020
}
2121

2222
for (const colNo in record) {
23-
24-
// TODO: what if the column is not a string?
25-
const { stringValue } = record[colNo];
2623
const { label } = columnMetadata[colNo];
2724

28-
row[label] = stringValue;
25+
// We assume that the record is a simple object with a single key-value pair.
26+
// For example, `{ longValue: 1 }` or `{ stringValue: "Acme Corp" }`.
27+
//
28+
// Fixes https://www.notion.so/localstack/Anders-Wasen-GraphQL-Error-for-Non-Nullable-Field-id-in-AppSync-Query-206fc2a2343181e79f95d0fa1dad82e3.
29+
row[label] = Object.values(record[colNo])[0];
2930
}
3031

3132
statement.push(row);

0 commit comments

Comments
 (0)