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:
Vincent Poulailleau 2017-10-30 16:00:18 +01:00 committed by GitHub
parent 36a902fbfa
commit 98c2af3fcc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,7 +48,7 @@ Mutations can also accept files, that's how it will work with different integrat
@classmethod
def mutate_and_get_payload(cls, root, info, **input):
# 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
# files = context.files