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.
2 parents 29c558e + 10a1b1b commit e5b0d82Copy full SHA for e5b0d82
graphene_mongo/fields.py
@@ -81,9 +81,18 @@ def fields(self):
81
82
@classmethod
83
def get_query(cls, model, info, **args):
84
+ objs = model.objects()
85
if args:
- return model.objects().filter(**args)
86
- return model.objects()
+ first = args.pop('first', None)
87
+ last = args.pop('last', None)
88
+ objs = objs.filter(**args)
89
+
90
+ if first is not None:
91
+ objs = objs[:first]
92
+ if last is not None:
93
+ objs = objs[:-last]
94
95
+ return objs
96
97
98
def merge_querysets(cls, default_queryset, queryset):
0 commit comments