Skip to content

Commit 3cf940d

Browse files
authored
Add ability to pass execution_context_class to GraphQLView.as_view() (#1109)
* Add ability to pass `execution_context_class` to `GraphQLView.as_view()` Currently when passing `execution_context_class` like this: ``` GraphQLView.as_view(execution_context_class=CustomContext) ``` you get the following error from `View.as_view()` ``` TypeError: GraphQLView() received an invalid keyword 'execution_context_class'. as_view only accepts arguments that are already attributes of the class. ``` this PR fixes the `hasattr` check in `.as_view`. Fixes: #1072 * make black happy removed whitespace
1 parent 3058118 commit 3cf940d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

graphene_django/views.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ class GraphQLView(View):
8484
pretty = False
8585
batch = False
8686
subscription_path = None
87+
execution_context_class = None
8788

8889
def __init__(
8990
self,

0 commit comments

Comments
 (0)