From f3a6c0bfe0894b2323fe82a8f4df96d152b820f1 Mon Sep 17 00:00:00 2001 From: Daniel Egger Date: Wed, 5 Sep 2018 16:38:31 +0200 Subject: [PATCH] MutateContentBlock with contents --- server/book/schema/mutations.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/book/schema/mutations.py b/server/book/schema/mutations.py index c6923bbd..8d03cfa2 100644 --- a/server/book/schema/mutations.py +++ b/server/book/schema/mutations.py @@ -11,6 +11,7 @@ class MutateContentBlock(graphene.relay.ClientIDMutation): id = graphene.ID() type = graphene.String() title = graphene.String() + contents = graphene.String() errors = graphene.List(graphene.String) content_block = graphene.Field(ContentBlockNode) @@ -24,8 +25,9 @@ class MutateContentBlock(graphene.relay.ClientIDMutation): id_param = kwargs['id'] type_param = kwargs['type'] title = kwargs['title'] + contents_data = kwargs['contents'] - new_content_block = ContentBlock(type=type_param, title=title) + new_content_block = ContentBlock(type=type_param, title=title, contents=contents_data) content_block = get_object(ContentBlock, id_param) content_block.add_sibling(instance=new_content_block, pos='right')