We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f26d023 commit 10a1b1bCopy full SHA for 10a1b1b
graphene_mongo/fields.py
@@ -84,12 +84,14 @@ def fields(self):
84
def get_query(cls, model, info, **args):
85
objs = model.objects()
86
if args:
87
+ first = args.pop('first', None)
88
+ last = args.pop('last', None)
89
objs = objs.filter(**args)
90
- if 'first' in args:
- objs = objs[:args['first']]
91
- if 'last' in args:
92
- objs = objs[:-args['last']]
+ if first is not None:
+ objs = objs[:first]
93
+ if last is not None:
94
+ objs = objs[:-last]
95
96
return objs
97
0 commit comments