You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The memory addresses of p2prop1 and p2prop2 are not equal which is right, but somehow mutating p2prop1.p1prop1 also affects to p2prop2.p1prop1 which leads to conclusion that calling constructor ParentType() when setting ParentType2 fields default_value leads to shallow copy instead of deep copy
What is the expected behavior?
When querying parent_two trough localhost:8000/graphql, we expect it return:
We would want ParentType() constructor always make new object instead of shallow copy
What is the motivation / use case for changing the behavior?
Current behaviour leads to unintuitive results
Please tell us about your environment:
Version:
graphene==2.1.8
graphene-django==2.10.1
Platform:
Ubuntu 18.04, Pycharm, community edition, Chromium browser
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow)
We can fix the behaviour by calling
Note: for support questions, please use stackoverflow. This repository's issues are reserved for feature requests and bug reports.
We have types:
In schema we call
When querying parent_two trough localhost:8000/graphql, it returns:
The memory addresses of p2prop1 and p2prop2 are not equal which is right, but somehow mutating p2prop1.p1prop1 also affects to p2prop2.p1prop1 which leads to conclusion that calling constructor ParentType() when setting ParentType2 fields default_value leads to shallow copy instead of deep copy
When querying parent_two trough localhost:8000/graphql, we expect it return:
We would want ParentType() constructor always make new object instead of shallow copy
What is the motivation / use case for changing the behavior?
Current behaviour leads to unintuitive results
Please tell us about your environment:
graphene==2.1.8
graphene-django==2.10.1
Ubuntu 18.04, Pycharm, community edition, Chromium browser
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow)
We can fix the behaviour by calling
The text was updated successfully, but these errors were encountered: