File tree 1 file changed +5
-1
lines changed
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,7 @@ class GraphQLView(View):
96
96
batch = False
97
97
subscription_path = None
98
98
execution_context_class = None
99
+ validation_rules = None
99
100
100
101
def __init__ (
101
102
self ,
@@ -107,6 +108,7 @@ def __init__(
107
108
batch = False ,
108
109
subscription_path = None ,
109
110
execution_context_class = None ,
111
+ validation_rules = None ,
110
112
):
111
113
if not schema :
112
114
schema = graphene_settings .SCHEMA
@@ -135,6 +137,8 @@ def __init__(
135
137
), "A Schema is required to be provided to GraphQLView."
136
138
assert not all ((graphiql , batch )), "Use either graphiql or batch processing"
137
139
140
+ self .validation_rules = validation_rules
141
+
138
142
# noinspection PyUnusedLocal
139
143
def get_root_value (self , request ):
140
144
return self .root_value
@@ -332,7 +336,7 @@ def execute_graphql_request(
332
336
)
333
337
)
334
338
335
- validation_errors = validate (schema , document )
339
+ validation_errors = validate (schema , document , self . validation_rules )
336
340
337
341
if validation_errors :
338
342
return ExecutionResult (data = None , errors = validation_errors )
You can’t perform that action at this time.
0 commit comments