File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change 32
32
33
33
INSTALLED_APPS = [
34
34
'graphene_django' ,
35
+ 'graphene_file_upload' ,
35
36
'django.contrib.admin' ,
36
37
'django.contrib.auth' ,
37
38
'django.contrib.contenttypes' ,
Original file line number Diff line number Diff line change @@ -16,6 +16,20 @@ class PostPaginatedType(graphene.ObjectType):
16
16
has_prev = graphene .Boolean ()
17
17
objects = graphene .List (PostType )
18
18
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
+
19
33
class Query (object ):
20
34
all_posts = graphene .List (PostType )
21
35
posts = graphene .Field (PostPaginatedType , page = graphene .Int ())
You can’t perform that action at this time.
0 commit comments