We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a3c3be2 commit 1232ff3Copy full SHA for 1232ff3
docs/relay/mutations.rst
@@ -27,3 +27,29 @@ subclass of ``relay.ClientIDMutation``.
27
ship = create_ship(ship_name, faction_id)
28
faction = get_faction(faction_id)
29
return IntroduceShip(ship=ship, faction=faction)
30
+
31
32
33
+Accepting Files
34
+-------------
35
36
+Mutations can also accept files, they will be in the context varibale
37
38
+.. code:: python
39
40
+ class UploadFile(graphene.ClientIDMutation):
41
+ class Input:
42
+ pass
43
+ # nothing needed for uploading file
44
45
+ # your return fields
46
+ success = graphene.String()
47
48
+ @classmethod
49
+ def mutate_and_get_payload(cls, input, context, info):
50
+ files = context.FILES
51
+ print(files)
52
53
+ # do something with files
54
55
+ return UploadFile(success=True)
0 commit comments