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

BUGFIX: don't filter out lookup_field as input (required for update) #1029

Merged

Conversation

CBuiVNG
Copy link
Contributor

@CBuiVNG CBuiVNG commented Aug 25, 2020

When using SerializerMutation the pkey/lookup field is filtered out. see (#906). It was introduced by #882.

This seems incorrect.

if "update" in cls._meta.model_operations and lookup_field in input:
is using lookup field to determine if we are updating or creating. Because of #882 primary key fields are treated as read-only and can never be used for lookup. We need to allow lookup_field in input.

The workaround #906 (comment) does not work with relay. (Id field are typically numeric vs string for relay ids)

Copy link
Collaborator

@zbyte64 zbyte64 left a comment

Choose a reason for hiding this comment

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

👍

@jkimbo jkimbo merged commit 65f41c1 into graphql-python:master Oct 19, 2020
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