diff --git a/Relay/Connection/Paginator.php b/Relay/Connection/Paginator.php index b062be391..cd3e0857e 100644 --- a/Relay/Connection/Paginator.php +++ b/Relay/Connection/Paginator.php @@ -68,13 +68,13 @@ public function forward($args) // If we don't have a cursor or if it's not valid, then we must not use the slice method if (!is_numeric(ConnectionBuilder::cursorToOffset($args['after'])) || !$args['after']) { - $entities = call_user_func($this->fetcher, $offset, $limit + 1); + $entities = call_user_func($this->fetcher, $offset, $limit ? $limit + 1 : $limit); return $this->handleEntities($entities, function ($entities) use ($args) { return ConnectionBuilder::connectionFromArray($entities, $args); }); } else { - $entities = call_user_func($this->fetcher, $offset, $limit + 2); + $entities = call_user_func($this->fetcher, $offset, $limit ? $limit + 2 : $limit); return $this->handleEntities($entities, function ($entities) use ($args, $offset) { return ConnectionBuilder::connectionFromArraySlice($entities, $args, [