Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add check for serializers.HiddenField on fields_for_serializer function #1419

Merged
merged 2 commits into from Jun 6, 2023

Conversation

sezginacer
Copy link
Contributor

This pull request solves the issue that causes hidden fields to appear in Input when both SerializerMutation and serializer class with HiddenField are used. This field class is usually used when you want to auto-populate a field, not filled by request's data. So, this field should not be appear in Input.

Copy link
Collaborator

@sjdemartini sjdemartini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Agreed this should be the behavior based on DRF docs on HiddenField saying

A field class that does not take a value based on user input, but instead takes its value from a default value or callable.

Thanks for adding the test!

@firaskafri firaskafri merged commit 8934393 into graphql-python:main Jun 6, 2023
12 checks passed
superlevure pushed a commit to loft-orbital/graphene-django that referenced this pull request Jul 19, 2023
…nction (graphql-python#1419)

* Add check for `serializers.HiddenField` on fields_for_serializer function

* Add pre-commit changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants