mirror of
https://github.com/graphql-python/graphene.git
synced 2024-11-11 04:07:16 +03:00
fix access to the request in Django
With the current documentation, I get after execution: "graphql.error.located_error.GraphQLLocatedError: name 'context' is not defined" I don't get any error after the correction I made (I haven't yet tried to upload a file…)
This commit is contained in:
parent
36a902fbfa
commit
98c2af3fcc
|
@ -48,7 +48,7 @@ Mutations can also accept files, that's how it will work with different integrat
|
||||||
@classmethod
|
@classmethod
|
||||||
def mutate_and_get_payload(cls, root, info, **input):
|
def mutate_and_get_payload(cls, root, info, **input):
|
||||||
# When using it in Django, context will be the request
|
# When using it in Django, context will be the request
|
||||||
files = context.FILES
|
files = info.context.FILES
|
||||||
# Or, if used in Flask, context will be the flask global request
|
# Or, if used in Flask, context will be the flask global request
|
||||||
# files = context.files
|
# files = context.files
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user