You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GraphQL Mutation requires an input object. This input object has optional fields, and all those fields are not set in a mutation call, the default Deserialization by this codegen utility for all those missing fields are set to default value if specified in the schema or "null". This will result in DGS/subgraph overwriting those fields with default value/"null", which is not desirable.
Codegen deserialization should mark fields that are not provided, so that the DGS/subgraph implementation can handle sparse updates.
mutation patchProfile($input: ProfileInput!) {
patchProfile(input: $input) {
id
name
address
}
Calls
Call 1
Input
{
"id": "1",
"address": "new address"
}
DGS for the field name gets default value when specified by schema or "null", and will overwrite the value that was already there for the name field.
After fixing this issue, only address should be updated and remaining fields should not be altered.
Call 2
Input
{
"id": "1",
"name": "New name",
"address": null
}
Deserialization works well for this now (DGS will set the address to null and name to "New name".
After fixing this issue, when the user explicitly sets a field to null, it should be honored.
The text was updated successfully, but these errors were encountered:
GraphQL Mutation requires an input object. This input object has optional fields, and all those fields are not set in a mutation call, the default Deserialization by this codegen utility for all those missing fields are set to default value if specified in the schema or "null". This will result in DGS/subgraph overwriting those fields with default value/"null", which is not desirable.
Codegen deserialization should mark fields that are not provided, so that the DGS/subgraph implementation can handle sparse updates.
Example
Schema
Mutation call
Calls
Call 1
Input
DGS for the field
name
gets default value when specified by schema or "null", and will overwrite the value that was already there for thename
field.After fixing this issue, only
address
should be updated and remaining fields should not be altered.Call 2
Input
Deserialization works well for this now (DGS will set the
address
to null andname
to "New name".After fixing this issue, when the user explicitly sets a field to null, it should be honored.
The text was updated successfully, but these errors were encountered: