mirror of
https://github.com/graphql-python/graphene.git
synced 2025-02-16 19:40:39 +03:00
Update mutations.rst
This commit is contained in:
parent
eb1ded2a65
commit
8f373ccec3
|
@ -31,9 +31,9 @@ subclass of ``relay.ClientIDMutation``.
|
||||||
|
|
||||||
|
|
||||||
Accepting Files
|
Accepting Files
|
||||||
-------------
|
---------------
|
||||||
|
|
||||||
Mutations can also accept files, they will be in the context variable.
|
Mutations can also accept files, that's how it will work with different integrations:
|
||||||
|
|
||||||
.. code:: python
|
.. code:: python
|
||||||
|
|
||||||
|
@ -47,8 +47,10 @@ Mutations can also accept files, they will be in the context variable.
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def mutate_and_get_payload(cls, input, context, info):
|
def mutate_and_get_payload(cls, input, context, info):
|
||||||
|
# When using it in Django, context will be the request
|
||||||
files = context.FILES
|
files = context.FILES
|
||||||
print(files)
|
# Or, if used in Flask, context will be the flask global request
|
||||||
|
# files = context.files
|
||||||
|
|
||||||
# do something with files
|
# do something with files
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user