mirror of
https://github.com/graphql-python/graphene-django.git
synced 2025-04-15 14:42:06 +03:00
fix order_by snake casing by checking if value is None, switch executor to execution_context_class since schema.execute no longer supports executor
This commit is contained in:
parent
ac8aaf8525
commit
81d167a290
|
@ -66,7 +66,7 @@ class DjangoFilterConnectionField(DjangoConnectionField):
|
|||
kwargs = {}
|
||||
for k, v in args.items():
|
||||
if k in filtering_args:
|
||||
if k == "order_by":
|
||||
if k == "order_by" and v is not None:
|
||||
v = to_snake_case(v)
|
||||
kwargs[k] = v
|
||||
return kwargs
|
||||
|
|
|
@ -1224,7 +1224,7 @@ def test_filter_filterset_based_on_mixin():
|
|||
}
|
||||
}
|
||||
|
||||
result = schema.execute(query, variable_values={"email": reporter_1.email})
|
||||
result = schema.execute(query, variable_values={"email": reporter_1.email},)
|
||||
|
||||
assert not result.errors
|
||||
assert result.data == expected
|
||||
|
|
|
@ -94,6 +94,7 @@ class GraphQLView(View):
|
|||
pretty=False,
|
||||
batch=False,
|
||||
subscription_path=None,
|
||||
execution_context_class=None,
|
||||
):
|
||||
if not schema:
|
||||
schema = graphene_settings.SCHEMA
|
||||
|
@ -111,6 +112,7 @@ class GraphQLView(View):
|
|||
self.pretty = self.pretty or pretty
|
||||
self.graphiql = self.graphiql or graphiql
|
||||
self.batch = self.batch or batch
|
||||
self.execution_context_class = execution_context_class
|
||||
if subscription_path is None:
|
||||
self.subscription_path = graphene_settings.SUBSCRIPTION_PATH
|
||||
|
||||
|
@ -307,10 +309,8 @@ class GraphQLView(View):
|
|||
|
||||
try:
|
||||
extra_options = {}
|
||||
if getattr(self, "executor", None):
|
||||
# We only include it optionally since
|
||||
# executor is not a valid argument in all backends
|
||||
extra_options["executor"] = self.executor
|
||||
if self.execution_context_class:
|
||||
extra_options["execution_context_class"] = self.execution_context_class
|
||||
|
||||
options = {
|
||||
"source": query,
|
||||
|
|
Loading…
Reference in New Issue
Block a user