Skip to content

Allow for partial updates by ignoring missing input fields #7948

Closed
@maurice-freitag

Description

@maurice-freitag

Product

Hot Chocolate

Is your feature request related to a problem?

I have defined a mutation to update an object. _id is a required parameter, everything else is optional. When I send one such query and only set a few of these properties, the context is still populated with the missing fields as soon as our middleware is hit, all of them having null values. We would like to support partial updates, so an input object only containing only the fields the user actually set would be preferred. The current implementation makes it impossible to determine if the user wanted to set a value to null explicitly or chose to not update the missing fields at all.

Image

I tracked the issue down to the InputParser, the missing values seem to be populated here.

The solution you'd like

Allow configuring the input parser to support the desired behavior.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions