Replies: 1 comment 1 reply
-
The overall number of possible options for inserting/updating a deep graph (forest) with nested optional branches is rather large and I'm not certain I can just give a one-size-fits-all solution. Could you provide a more concrete task you're trying to do here? Ideally with some sample data to use in examples. I'll outline some basic thoughts on how I would approach something like this here:
Since you're mixing inserts and updates you might need to make use of the top-level I'm sure I could provide more specific answers for a more specific task. "Optional values" can mean so many things, that it's hard to cover them all in one generic overview. Optional properties may have defaults and if you simply assign |
Beta Was this translation helpful? Give feedback.
-
Hi,
I'm wondering what the best way is, to insert/update a sub-graph, if I have a complex, nested JSON object from a GraphQL API.
The EdgeDB schema is generated from the GraphQL schema, and I can generate the code that inserts/updates the data in EdgeDB.
For simple sub-graphs, this doesn't seem too difficult.
However, my sub-graph is quite complex, with many optional fields, so I'm not 100% sure what the best way is, to implement such an insert/update in a single EdgeDB query.
There was a discussion about this in the past: Storing entire graph of objects and sub-objects.
I'm wondering if anything changed since.
Right now, I see the following options:
Beta Was this translation helpful? Give feedback.
All reactions