Skip to content

Question: Mutate Arguments missing (as undefined) vs null #441

@MarkRuseEL

Description

@MarkRuseEL

I'm working with input classes where all properties are nullable. In my mutations, which each take a single argument (args of the relevant input class), I'm finding it challenging to differentiate between properties that were explicitly set to null and those that were omitted entirely from the payload.

On the client side, I set some fields to undefined, so they are not included in the incoming payload. However, on the server, it's difficult to tell whether a property was intentionally set to null or was simply not supplied.

It would be really helpful if the library could provide a way to determine which fields were included in the payload. I've noticed that some libraries offer a feature like IResolverContext, which allows querying the fields explicitly provided in the request. I have been through the documentation but am struggling to work out if this is supported or if there a alternative approach for handling this scenario?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions