Skip to content

Django form returns inputs in payload but errors if you try to access #775

Closed
@sandwichsudo

Description

@sandwichsudo

Hiya, I've made a simple DjangoFormMutation following the docs.

It looks like the form inputs are included in the payload type, but if you try and access them you get an error like Cannot return null for non-nullable field MyMutationPayload.name.

I'm sure there is a good use-case for returning these fields, but there are some fields (like passwords) I'd prefer I could exclude from being returned. I've tried using only_fields and exclude_fields but they apply equally to input and output which isn't quite what I'm looking for.

Are there any recommendations to remove form fields from the payload here please? Or should I just not be using DjangoFormMutation if I don't want the fields returned?

Thanks,
Gilly

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions