@@ -19,7 +19,7 @@ class Query(graphene.ObjectType):
1919 all_posts = graphene .List (PostType )
2020 post = graphene .Field (PostType , post_id = graphene .Int ())
2121 all_authors = graphene .List (AuthorType )
22- author = graphene .Field (AuthorType , author_id_id = graphene .Int ())
22+ author = graphene .Field (AuthorType , author_id = graphene .Int ())
2323
2424 def resolve_all_posts (self , info , ** kwargs ):
2525 return Post .objects .all ()
@@ -39,6 +39,7 @@ class PostInput(graphene.InputObjectType):
3939 author = graphene .Int ()
4040 category = graphene .String ()
4141 backgroundlink = graphene .String ()
42+ content = graphene .String ()
4243
4344class AuthorInput (graphene .InputObjectType ):
4445 id = graphene .ID ()
@@ -57,7 +58,8 @@ def mutate(root, info, post_data=None):
5758 title = post_data .title ,
5859 author = Author .objects .get (pk = post_data .author ),
5960 backgroundlink = post_data .backgroundlink ,
60- category = post_data .category
61+ category = post_data .category ,
62+ content = post_data .content
6163 )
6264 post_instance .save ()
6365 return CreatePost (post = post_instance )
@@ -93,6 +95,7 @@ def mutate(root, info, post_data=None):
9395 post_instance .author = Author .objects .get (pk = post_data .author )
9496 post_instance .backgroundlink = post_data .backgroundlink
9597 post_instance .category = post_data .category
98+ post_instance .content = post_data .content
9699 post_instance .save ()
97100
98101 return UpdatePost (post = post_instance )
@@ -153,4 +156,4 @@ class Mutation(graphene.ObjectType):
153156 delete_author = DeleteAuthor .Field ()
154157
155158
156- schema = graphene .Schema (query = Query , mutation = Mutation )
159+ schema = graphene .Schema (query = Query , mutation = Mutation )
0 commit comments