Skip to content

Commit 5dfabd0

Browse files
Arun S KumarArun S Kumar
authored andcommitted
Query efficiency and performance - Retrieving only the queried fields from the database by implementing deafult resolvers for both ReferenceField & CachedReferenceField.
1 parent b72dcf4 commit 5dfabd0

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

graphene_mongo/fields.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -245,12 +245,6 @@ def chained_resolver(self, resolver, is_partial, root, info, **args):
245245
if camel_to_snake(field) in self.model._fields_ordered:
246246
only_fields.append(camel_to_snake(field))
247247
if not bool(args) or not is_partial:
248-
if isinstance(self.model, mongoengine.Document) or isinstance(self.model,
249-
mongoengine.base.metaclasses.TopLevelDocumentMetaclass):
250-
args_copy = args.copy()
251-
for arg_name, arg in args.copy().items():
252-
if arg_name not in self.model._fields_ordered:
253-
args_copy.pop(arg_name)
254248
# XXX: Filter nested args
255249
resolved = resolver(root, info, **args)
256250
if resolved is not None:

0 commit comments

Comments
 (0)