class CreatePost(graphene.Mutation):
"""Mutation to create a post."""
post = graphene.Field(lambda: PostObject, description="Post created by this mutation.")
input = CreatePostInput(required=True)
def mutate(self, info, input):
return CreatePost(post=post)