Skip to content

Commit

Permalink
fix: Distinct on model primary key (#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
erikgaal authored Jul 15, 2020
1 parent 5a8e1b2 commit b21d115
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Queries/EloquentCollectionQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ public function resolve(Arguments $args, $root, $context, ResolveInfo $info): Le
$query = $this->applyOrderBy($query, $args->orderBy);
}

return $query->distinct()->bakeryPaginate($count, ['*'], 'page', $page);
return $query->distinct($this->model->getQualifiedKeyName())
->bakeryPaginate($count, ['*'], 'page', $page);
}
}

0 comments on commit b21d115

Please sign in to comment.