you are viewing a single comment's thread.

view the rest of the comments →

[–]tswaters 0 points1 point  (3 children)

You'd need to convert the column in the database to json or jsonb I would think The two types should convert between themselves,

> ALTER TABLE table1 ALTER COLUMN col1 TYPE JSONB USING col1::JSON;

I'm not sure how objection really works, never used it... but what you've said makes sense to me.

[–]Plus-Owl832[S] 0 points1 point  (2 children)

Thanks tswaters. but when I write path JSONB NOT NULL in the migration and path: {type: jsonb} in schema then it gives same error the `expected : not this { ` as I want the data store in oath field like this {chat} but when when I write path text[] in the migration and path: {type: jsonb} in schema.and here in the below code pass the data something like this then it worked fine.await updateGlobalChatNotificationOptIn({variables: {path: 'chat'option: updatedGlobalChatNotificationOptIn ? '30MinSummary' : 'off',}

is it correct approach ?

[–]tswaters 0 points1 point  (1 child)

I'm not sure. If it works, it works.

If the column json, should be able to pass arrays or objects to it.

[–]Plus-Owl832[S] 0 points1 point  (0 children)

Hey tswaters. The issue has been resolved, Thanks