-
I want to using interface with Mutation because there are some fields that I have calculate before return to user. So i have to rewrite resolves to create and update. How can I use interface with Mutation? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
When you say interface do you mean the graphene interfaces like how In any event, I have used both mixin and decorator patterns to recycle code on mutations. Sample of a decorator that can wrap the resolver method though I would recommend using a mixin if you can:
Edit: stackoverflow on mixins: https://stackoverflow.com/questions/533631/what-is-a-mixin-and-why-are-they-useful |
Beta Was this translation helpful? Give feedback.
-
Great! I solved my problem, thank you for answer. |
Beta Was this translation helpful? Give feedback.
When you say interface do you mean the graphene interfaces like how
relay.Node
gets used?In any event, I have used both mixin and decorator patterns to recycle code on mutations.
Sample of a decorator that can wrap the resolver method though I would recommend using a mixin if you can:
Edit: stackoverflow on mixins: https://stackoverflow.com/questions/533631/what-is-a-mixin-and-why-are-they-useful