Skip to content

Commit 94cfcb2

Browse files
committed
working
1 parent c9a02d6 commit 94cfcb2

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

api/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232

3333
INSTALLED_APPS = [
3434
'graphene_django',
35+
'graphene_file_upload',
3536
'django.contrib.admin',
3637
'django.contrib.auth',
3738
'django.contrib.contenttypes',

zooper/schema.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,20 @@ class PostPaginatedType(graphene.ObjectType):
1616
has_prev = graphene.Boolean()
1717
objects = graphene.List(PostType)
1818

19+
class CreatePost(graphene.Mutation):
20+
description = graphene.String()
21+
adoption = graphene.Boolean()
22+
adoption_url = graphene.String()
23+
24+
class Arguments:
25+
description = graphene.String()
26+
adoption = graphene.Boolean()
27+
adoption_url = graphene.String()
28+
29+
def mutate(self, info, description):
30+
post = Post(description=description)
31+
32+
1933
class Query(object):
2034
all_posts = graphene.List(PostType)
2135
posts = graphene.Field(PostPaginatedType, page=graphene.Int())

0 commit comments

Comments
 (0)