Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
06-22-2020 02:08 PM
I am attempting to store comments in a GRANDstack application. I currently store the comment like this:
type Comment {
id: ID!
author: ID!
delta: String
}
Where delta is a quilljs delta object that I have stringified and looks like this:
{"ops":[{"insert":"Test comment\n"}]}
What would be the best way to turn this back into an object when I query for a comment in my graphql schema?
Do I need some kind of apoc function on the Comment type for the delta property? The only solution I can think of right now is to JSON.parse(delta) on the client side, but this would be rather convoluted and inefficient for me. Thanks for any help or suggestions!
Solved! Go to Solution.
06-22-2020 02:29 PM
I believe you can actually store it as a JSON object and use that type and declar a
scalar JSON
type that you can use. You could also store it as a map or something of that nature.
06-22-2020 02:29 PM
I believe you can actually store it as a JSON object and use that type and declar a
scalar JSON
type that you can use. You could also store it as a map or something of that nature.
06-22-2020 04:32 PM
Forgive me, I'm new to using Neo4j and GraphQL. Could you help me understand how to declare a scalar JSON type in my GraphQL schema file?
06-25-2020 07:30 AM
Just like above. You would put that in your schema and then you can use it like Dog: JSON, etc.
06-22-2020 07:36 PM
Hi, you can save as JSON String so you convert this in your app
Ok.
All the sessions of the conference are now available online