File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -33,15 +33,16 @@ from webob_graphql import serve_graphql_request
33
33
# In summary, don't use the renderer='json' here :)
34
34
)
35
35
def graphql_view (request ):
36
- return serve_graphql_request(request, schema)
36
+ context = {' session' : request.session}
37
+ return serve_graphql_request(request, schema, context_value = context)
37
38
38
39
# Optional, for adding batch query support (used in Apollo-Client)
39
- return serve_graphql_request(request, schema, batch_enabled = True )
40
+ return serve_graphql_request(request, schema, batch_enabled = True , context_value = context )
40
41
```
41
42
42
43
### Supported options
43
44
* ` schema ` : The ` GraphQLSchema ` object that you want the view to execute when it gets a valid request.
44
- * ` context ` : A value to pass as the ` context ` to the ` graphql() ` function.
45
+ * ` context_value ` : A value to pass as the ` context ` to the ` graphql() ` function.
45
46
* ` root_value ` : The ` root_value ` you want to provide to ` executor.execute ` .
46
47
* ` format_error ` : If you want to use a custom error formatter.
47
48
* ` pretty ` : Whether or not you want the response to be pretty printed JSON.
You can’t perform that action at this time.
0 commit comments