-
|
Hi, I was wondering if the DGS framework has any pattern to implement partial mutations (HTTP PATCH-like). I didn't find anything on the documentation, but I wanted to check if it has been solved already. I can see how using the input type as Maps in the data-fetcher could help, but I wondered if there is a pattern that involves using the Kotlin Generated Types. Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 5 replies
-
|
Are partial mutations something in the GraphQL spec? I’m not aware of this being supported. I don’t think there’s anything specified about how a server is supposed to handle a mutation. If, for example, you have a mutation that takes an |
Beta Was this translation helpful? Give feedback.
-
|
In our API, we use an intermediate input object : if the whole object is null, it means we don't want to patch the field, if the value inside the object is null, it means we want to set the field to null. Unfortunately, we have to create such intermediate objects for each types of input data but it works well |
Beta Was this translation helpful? Give feedback.
-
|
Got it. I’m trying to do something similar. I guess that what I’m trying to understand is with the current implementation when you receive a mutation input, how do you determine what fields were passed by the GraphQL client. How do you identify a null intended to set the value to null versus no present? Thanks, @victorlevasseur !!! |
Beta Was this translation helpful? Give feedback.
-
|
FYI, Found an answer related to this: #796 |
Beta Was this translation helpful? Give feedback.
FYI, Found an answer related to this: #796