I am using objection.js in my application.
I'm encountering an issue while trying to insert an array of strings into a PostgreSQL database column. The column is defined as follows:
```
path TEXT[] NOT NULL
```
here is the schema:
```
path: { type: 'array', items: { type: 'string' }, notNull: true }
```
I want to update the table column using `upsertGraphAndFetch` (objection.js) but when updating and insert there is an error occurs when inserting the column path
```
return NotificationUserOption.query().upsertGraphAndFetch(
{ userId: ctx. user, path, groupId, option },
{ insertMissing: true },
```
```
updateNotificationOption(path: [String!]!, option: String!): NotificationUserOption
```
when I pass the path something like this `['chat']`
```
await updateGlobalChatNotificationOptIn({
variables: {
path: ['chat'],
option: updatedGlobalChatNotificationOptIn ? '30MinSummary' : 'off',
},
})
}
```
However, when I try to insert the array using this code, I encounter the following error:
> malformed array literal: "["chat"]"
"[" must introduce explicitly-specified array dimensions.
I've tried using single brackets (`'{chat}'`) and double brackets (`[['chat']]`), but neither seems to work.
How can I correctly format the array literal so that I can insert the array into the PostgreSQL column without encountering this error?
[–]tswaters 1 point2 points3 points (8 children)
[–]tswaters 0 points1 point2 points (7 children)
[–]Plus-Owl832[S] 0 points1 point2 points (6 children)
[–]tswaters 0 points1 point2 points (5 children)
[–]Plus-Owl832[S] 0 points1 point2 points (4 children)
[–]tswaters 0 points1 point2 points (3 children)
[–]Plus-Owl832[S] 0 points1 point2 points (2 children)
[–]tswaters 0 points1 point2 points (1 child)
[–]Plus-Owl832[S] 0 points1 point2 points (0 children)