Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion graphene_django/rest_framework/mutation.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def __init_subclass_with_meta__(cls, serializer_class=None,

@classmethod
def mutate_and_get_payload(cls, root, info, **input):
serializer = cls._meta.serializer_class(data=input)
serializer = cls._meta.serializer_class(data=input, context=getattr(info, 'context', None))
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe there is a chance this might break if someone has overridden their serializer class's __init__ in such a way as to not accept **kwargs. Even then, if they don't pop the context kwarg off before the base DRF Field class is resolved, I think this could cause an error.


if serializer.is_valid():
return cls.perform_mutate(serializer, info)
Expand Down